-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
30 lines (21 loc) · 856 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM node:lts AS build
ENV APP_ENV=${APP_ENV:-prod}
WORKDIR /usr/src/app
COPY . .
RUN npm install
RUN npm run build
FROM httpd:latest
# We can take any server name (e.g. example.com), which allows us to redirect
# to that name if reached via any other URL
ARG SERVER_NAME
ENV SERVER_NAME=${SERVER_NAME:-localhost}
ENV PORT=80
# Commented out because the COPY below overwrites (to enable modrewrite)
#RUN sed -i 's/80/${PORT}/g' /usr/local/apache2/conf/httpd.conf
# Put ServerName at the top of the Apache Config
RUN echo ServerName ${SERVER_NAME} > newconfig
COPY docker/httpd.conf /usr/local/apache2/conf/httpd.conf
RUN cat /usr/local/apache2/conf/httpd.conf >> newconfig
RUN mv newconfig /usr/local/apache2/conf/httpd.conf
COPY docker/.htaccess /usr/local/apache2/htdocs/.htaccess
COPY --from=build /usr/src/app/dist/ /usr/local/apache2/htdocs/