Last active
October 9, 2024 19:03
-
-
Save thewh1teagle/02c29853f496a8fb8b31abdf10fced2e to your computer and use it in GitHub Desktop.
Docker Challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| server: | |
| image: server | |
| build: | |
| context: docker-challenge-server | |
| ports: | |
| - 1337:1337 | |
| client: | |
| image: client | |
| build: | |
| context: docker-challenge-client | |
| ports: | |
| - 4173:4173 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Server | |
| FROM node:22-bookworm | |
| WORKDIR /app | |
| COPY . . | |
| RUN npm install | |
| RUN npm run build | |
| EXPOSE 1337 | |
| CMD ["npm", "run", "prod"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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