Skip to content

Instantly share code, notes, and snippets.

@thewh1teagle
Last active October 9, 2024 19:03
Show Gist options
  • Select an option

  • Save thewh1teagle/02c29853f496a8fb8b31abdf10fced2e to your computer and use it in GitHub Desktop.

Select an option

Save thewh1teagle/02c29853f496a8fb8b31abdf10fced2e to your computer and use it in GitHub Desktop.
Docker Challenge
services:
server:
image: server
build:
context: docker-challenge-server
ports:
- 1337:1337
client:
image: client
build:
context: docker-challenge-client
ports:
- 4173:4173
# Server
FROM node:22-bookworm
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
EXPOSE 1337
CMD ["npm", "run", "prod"]
# Client
# Rename me to Dockerfile
FROM node:22-bookworm
WORKDIR /app
COPY . .
RUN npm install
ENV VITE_BASE_URL="http://localhost:1337"
RUN npm run build
EXPOSE 4173
CMD ["npx", "vite", "preview", "--host", "0.0.0.0"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment