Skip to content

Instantly share code, notes, and snippets.

@RaimonxDev
Last active June 23, 2023 14:57
Show Gist options
  • Save RaimonxDev/55c9ec7b69a550fad64a1e7686f0ae5c to your computer and use it in GitHub Desktop.
Save RaimonxDev/55c9ec7b69a550fad64a1e7686f0ae5c to your computer and use it in GitHub Desktop.
########## App React ###########
version: "3.3"
services:
CHANGE_BY_NAME_YOUR_SERVICES:
container_name: CHANGE_BY_YOUR_CONTAINER_NAME
# CHANGE BY YOUR IMAGE APP-REACT
image: plazafrontend/app-react:lts
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
# HABILITAMOS LA CONEXION HTTPS A UN ENTREPOINT
- "traefik.http.routers.CHANGE_NAME_ROUTER.entrypoints=CHANGE_BY_YOUR_ENTRYPOINT"
- "traefik.http.routers.CHANGE_NAME_ROUTER.rule=Host(`CHANGE_BY_YOUR_DOMAIN`)"
- "traefik.http.routers.CHANGE_NAME_ROUTER.tls=true"
# RESOLVER PARA CREAR EL CERTIFICADO
- "traefik.http.routers.CHANGE_NAME_ROUTER.tls.certresolver=CHANGE_BY_YOUR_RESOLVER"
networks:
- traefik
- CHANGE_BY_YOU_NETWORK
networks:
traefik:
external: true
CHANGE_BY_YOU_NETWORK:
FROM node:lts-alpine3.10 as node
RUN mkdir /app
COPY package.json yarn.lock /app/
WORKDIR /app
# Instala dependencias de nuestra App
RUN yarn install
# Copia toda la aplicacion al directorio app
COPY ./ /app/
# Construimos nuestra App
RUN yarn build
# Copiamos la build de nuestro App a nginx
FROM nginx:1.19.10-alpine
COPY --from=node /app/build /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment