Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: added volume, network and port to docker compose #814

Merged
merged 5 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 43 additions & 29 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
version: '3.1'

networks:
bracket_lan:
driver: bridge
djpiper28 marked this conversation as resolved.
Show resolved Hide resolved

volumes:
bracket_pg_data:


services:
bracket-frontend:
image: ghcr.io/evroon/bracket-frontend
container_name: bracket-frontend
ports:
- "3000:3000"
environment:
NEXT_PUBLIC_API_BASE_URL: "http://localhost:8400"
NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "10000000-ffff-ffff-ffff-000000000001" # Public test key
restart: unless-stopped
bracket-backend:
container_name: bracket-backend
depends_on:
- postgres
environment:
ENVIRONMENT: DEVELOPMENT
PG_DSN: postgresql://bracket_dev:bracket_dev@postgres:5432/bracket_dev
image: ghcr.io/evroon/bracket-backend
networks:
- bracket_lan
ports:
- 8400:8400
restart: unless-stopped
volumes:
- ./backend/static:/app/static

bracket-backend:
image: ghcr.io/evroon/bracket-backend
container_name: bracket-backend
ports:
- "8400:8400"
environment:
ENVIRONMENT: "DEVELOPMENT"
PG_DSN: "postgresql://bracket_dev:bracket_dev@postgres:5432/bracket_dev"
volumes:
- ./backend/static:/app/static
restart: unless-stopped
depends_on:
- postgres
bracket-frontend:
djpiper28 marked this conversation as resolved.
Show resolved Hide resolved
container_name: bracket-frontend
environment:
NEXT_PUBLIC_API_BASE_URL: http://localhost:8400
NEXT_PUBLIC_HCAPTCHA_SITE_KEY: 10000000-ffff-ffff-ffff-000000000001
image: ghcr.io/evroon/bracket-frontend
ports:
- 3000:3000
restart: unless-stopped

postgres:
image: postgres
restart: always
environment:
POSTGRES_DB: bracket_dev
POSTGRES_USER: bracket_dev
POSTGRES_PASSWORD: bracket_dev
postgres:
djpiper28 marked this conversation as resolved.
Show resolved Hide resolved
environment:
POSTGRES_DB: bracket_dev
POSTGRES_PASSWORD: bracket_dev
POSTGRES_USER: bracket_dev
image: postgres
networks:
- bracket_lan
restart: always
volumes:
- bracket_pg_data:/var/lib/postgresql/data
11 changes: 6 additions & 5 deletions docs/docs/deployment/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ services:
ports:
- "3000:3000"
environment:
NEXT_PUBLIC_API_BASE_URL: "https://bracket.mywebsite.com"
# Go to https://dashboard.hcaptcha.com/signup, create a site and put the site key here
NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "xxxxx"
NODE_ENV: "production"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still want to keep the NODE_ENV: "production" right?

NEXT_PUBLIC_API_BASE_URL: "http://your-site.com:8400"
NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "10000000-ffff-ffff-ffff-000000000001" # Public test key
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to keep the instruction # Go to https://dashboard.hcaptcha.com/signup, create a site and put the site key here here, since it is more clear what the value here should be. Putting a test key here would probably result in users just copy/pasting and accidentally using the test key in production without noticing I think

restart: unless-stopped

bracket-backend:
Expand All @@ -31,8 +29,11 @@ services:
environment:
ENVIRONMENT: "PRODUCTION"
PG_DSN: "postgresql://bracket_prod:bracket_prod@postgres:5432/bracket_prod"
CORS_ORIGINS: https://your-site.com
CORS_ORIGIN_REGEX: ^https://your-site.com$
JWT_SECRET: change_me
volumes:
- ./backend/static:/app/static
- ./backend/static:/app/static
restart: unless-stopped
depends_on:
- postgres
Expand Down