Skip to content

Instantly share code, notes, and snippets.

@jlandure
Created June 16, 2020 13:50
Show Gist options
  • Save jlandure/447256d656c745d8ba563d95e8badbc1 to your computer and use it in GitHub Desktop.
Save jlandure/447256d656c745d8ba563d95e8badbc1 to your computer and use it in GitHub Desktop.
Nginx with Docker
FROM zenika/alpine-node as build
COPY package.json package-lock.json ./
RUN npm i
COPY . .
RUN npm run build
FROM nginx:alpine
ENV PORT 8080
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
CMD sh -c "sed -i -e 's/80;/${PORT};/g' /etc/nginx/conf.d/default.conf \
&& exec nginx -g 'daemon off;'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment