Skip to content

Commit

Permalink
fix(docker): reset compose configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarlier committed Jan 29, 2022
1 parent 80d6c7f commit 7be8c01
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 32 deletions.
70 changes: 39 additions & 31 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
version: "3"

services:
#######################################
# Reverse proxy (Traefik)
#######################################
traefik:
image: traefik:2.1
command: >
--providers.docker=true
--api.dashboard=true
--api.insecure=true
--log.level=INFO
--entryPoints.web.address=:80
restart: always
ports:
- "${PORT:-3000}:80"
- "${RPROXY_PORT:-8080}:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- traefik.enable=false

########################################
# PostgreSQL
########################################
Expand All @@ -10,9 +30,7 @@ services:
environment:
- POSTGRES_DB=${POSTGRES_DB:-readflow}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
networks:
- internal
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-secret}
volumes:
- db-data:/var/lib/postgresql/data
labels:
Expand All @@ -31,8 +49,6 @@ services:
options:
max-size: "1m"
restart: always
networks:
- internal
labels:
- "traefik.enable=false"

Expand All @@ -45,39 +61,31 @@ services:
restart: always
depends_on:
- db
networks:
- web
- internal
environment:
- READFLOW_DB=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB:-readflow}?sslmode=disable
- READFLOW_DB=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-secret}@db/${POSTGRES_DB:-readflow}?sslmode=disable
- READFLOW_LISTEN_METRICS=:9090
- READFLOW_IMAGE_PROXY_URL=http://imaginary:9000
labels:
- "traefik.port=8080"
- "traefik.frontend.rule=Host:api.${FQDN}"
- "traefik.docker.network=${GW_NETWORK_NAME}"
- "traefik.http.services.api.loadbalancer.server.port=8080"
- "traefik.http.routers.api.priority=2"
- "traefik.http.routers.api.rule=PathPrefix(`/api`)"
- "traefik.http.routers.api.middlewares=api-stripprefix@docker"
- "traefik.http.middlewares.api-stripprefix.stripprefix.prefixes=/api"

# ########################################
# # Webapp
# ########################################
# app:
# build: ./ui/
# image: "ncarlier/readflow-app:latest"
# restart: always
# networks:
# - web
# - internal
# labels:
# - "traefik.port=80"
# - "traefik.frontend.rule=Host:${FQDN}"
# - "traefik.docker.network=${GW_NETWORK_NAME}"
########################################
# Webapp
########################################
app:
build: ./ui/
image: "ncarlier/readflow-app:latest"
restart: always
labels:
- "traefik.http.services.webapp.loadbalancer.server.port=80"
- "traefik.http.routers.webapp.priority=1"
- "traefik.http.routers.webapp.rule=PathPrefix(`/`)"

networks:
web:
external:
name: "${GW_NETWORK_NAME}"
internal:
external: false
default:

volumes:
db-data:
3 changes: 2 additions & 1 deletion ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ FROM node:lts-alpine AS builder
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
ENV REACT_APP_API_ROOT https://api.readflow.app
ENV REACT_APP_API_ROOT /api
ENV REACT_APP_REDIRECT_URL /login

# Install dependencies
COPY package.json /usr/src/app/package.json
Expand Down

0 comments on commit 7be8c01

Please sign in to comment.