Skip to content

Instantly share code, notes, and snippets.

@arthurgeek
Forked from enriquesaid/Dockerfile
Last active October 24, 2023 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthurgeek/c7f81f728d6aef1cf6750f8a692d71f7 to your computer and use it in GitHub Desktop.
Save arthurgeek/c7f81f728d6aef1cf6750f8a692d71f7 to your computer and use it in GitHub Desktop.
services:
web:
build:
context: .
target: development
ports:
- "3000:4321"
volumes:
- "./:/app"
- "/app/.tscache"
- "/app/node_modules"
FROM node:20-alpine as development
WORKDIR /app
COPY package*.json .
RUN npm install
COPY . .
EXPOSE 4321
CMD [ "npm", "run", "start" ]
FROM development as builder
WORKDIR /app
RUN npm run build
FROM nginx:1.25.2-alpine-slim as production
COPY --from=builder /app/dist /usr/local/apache2/htdocs/
EXPOSE 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment