deployment: merge into root dockerfile
This commit is contained in:
+8
-1
@@ -15,4 +15,11 @@ RUN yarn build
|
||||
FROM nginx:mainline
|
||||
|
||||
COPY --from=builder /app/packages/app/build /usr/share/nginx/html
|
||||
COPY ./docker/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Run nginx as root
|
||||
RUN sed -i 's/user nginx.*$//' /etc/nginx/nginx.conf
|
||||
|
||||
COPY docker/default.conf.template /etc/nginx/conf.d/default.conf.template
|
||||
CMD /bin/bash -c "envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf" && nginx -g 'daemon off;'
|
||||
|
||||
ENV PORT 80
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
FROM node:12 as builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock .yarnrc .npmrc /app/
|
||||
COPY .yarn /app/.yarn
|
||||
COPY packages /app/packages
|
||||
COPY plugins /app/plugins
|
||||
|
||||
RUN yarn
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN yarn build
|
||||
|
||||
FROM nginx:mainline
|
||||
|
||||
COPY --from=builder /app/packages/app/build /usr/share/nginx/html
|
||||
|
||||
# Run nginx as root
|
||||
RUN sed -i 's/user nginx.*$//' /etc/nginx/nginx.conf
|
||||
|
||||
# Copy in the nginx conf template and replace "$PORT" with the environment variable set by heroku
|
||||
COPY deployment/default.conf.template /etc/nginx/conf.d/default.conf.template
|
||||
CMD /bin/bash -c "envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf" && nginx -g 'daemon off;'
|
||||
@@ -1,8 +0,0 @@
|
||||
server {
|
||||
listen $PORT default_server;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen $PORT;
|
||||
server_name localhost;
|
||||
|
||||
#charset koi8-r;
|
||||
@@ -20,4 +20,3 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user