Skip to content

Commit

Permalink
fix: docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
David200308 committed Jan 15, 2025
1 parent a055ab0 commit 23c0083
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ RUN npm install

COPY --chown=node:node . .

EXPOSE 3001
EXPOSE 3000

CMD [ "npm", "run", "start" ]
33 changes: 23 additions & 10 deletions Backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
version: "3"
services:
reverse-proxy:
image: traefik:v3.1
command:
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=admin@skyproton.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- letsencrypt:/letsencrypt
- "/var/run/docker.sock:/var/run/docker.sock"

backend:
# build: .
image: ghcr.io/david200308/authentication-system/backend
Expand All @@ -8,8 +29,6 @@ services:
- "traefik.http.routers.backend.rule=Host(\"auth.api.skyproton.com\")"
- "traefik.http.routers.backend.entrypoints=websecure"
- "traefik.http.routers.backend.tls.certresolver=myresolver"
# ports:
# - "3001:3001"
environment:
- DB_HOST=mysql
- DB_USER=root
Expand Down Expand Up @@ -40,8 +59,6 @@ services:
- mailgun_api_key
- mailgun_from_domain
- sentry_dsn
networks:
- proxy-network
deploy:
# mode: replicated
# replicas: 3
Expand All @@ -60,7 +77,7 @@ services:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql_root_password
MYSQL_DATABASE: AUTHDB
volumes:
- db_data:/var/lib/mysql
- mysql_data:/var/lib/mysql
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
- ./database.sql:/docker-entrypoint-initdb.d/database.sql
secrets:
Expand All @@ -87,7 +104,7 @@ services:
volumes:
letsencrypt:
driver: local
db_data:
mysql_data:
driver: local
redis:
driver: local
Expand Down Expand Up @@ -117,7 +134,3 @@ secrets:
external: true
sentry_dsn:
external: true

networks:
proxy-network:
external: true

0 comments on commit 23c0083

Please sign in to comment.