-
-
Save Rafat97/143e74ecbde712003e72d68015333204 to your computer and use it in GitHub Desktop.
π³π³ Docker Compose django & python π³π³
This file contains 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
version: "3.3" | |
networks: | |
react-frontend-network: | |
services: | |
# web: | |
# build: | |
# context: . | |
# dockerfile: ./Dockerfile_create_react_app.DEV | |
# command: yarn run start | |
# container_name: react-frontend-app | |
# image: react-frontend-app-dev:v1 | |
# restart: always | |
# volumes: | |
# - ./:/usr/src/app | |
# - /usr/src/app/node_modules | |
# ports: | |
# - "3000:3000" | |
# networks: | |
# - react-frontend-network | |
web-prod: | |
build: | |
context: . | |
dockerfile: ./Dockerfile_create_react_app.PROD | |
container_name: react-frontend-app | |
image: react-frontend-app-prod:v1 | |
restart: always | |
ports: | |
- "3000:80" | |
networks: | |
- react-frontend-network |
This file contains 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
FROM node:lts-alpine | |
RUN apk add --no-cache libc6-compat | |
ENV NODE_ENV development | |
WORKDIR /usr/src/app | |
COPY ./package.json /usr/src/app/ | |
RUN yarn install --frozen-lockfile | |
EXPOSE 3000 |
This file contains 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
FROM node:lts-alpine as build | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app/code | |
COPY . /app/code | |
RUN yarn install --frozen-lockfile | |
RUN yarn run build | |
FROM nginx:stable-alpine | |
COPY --from=build /app/code/build /usr/share/nginx/html | |
EXPOSE 80 | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment