wip: added docker compose file
This commit is contained in:
139
docker-compose.yaml
Normal file
139
docker-compose.yaml
Normal file
@@ -0,0 +1,139 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
valkey-mywebsite:
|
||||
image: valkey/valkey:8.0.2
|
||||
container_name: valkey-mywebsite
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- valkey_data:/data
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- app_network
|
||||
healthcheck:
|
||||
test: ["CMD", "valkey-cli", "ping"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
postgres-mywebsite:
|
||||
image: postgres:16
|
||||
container_name: postgres-mywebsite
|
||||
# fill these in with postgres env vars
|
||||
environment:
|
||||
POSTGRES_USER: wyatt
|
||||
POSTGRES_PASSWORD: test # <<< replace this
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./init-db:/docker-entrypoint-initdb.d
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- app_network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U wyatt -d postgres"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
container_name: frontend
|
||||
ports:
|
||||
- "8000:8000"
|
||||
# fill these in the frontend env vars for prod
|
||||
environment:
|
||||
- BASE_URI_API=
|
||||
- BASE_URI_WEB=
|
||||
- EMAIL_FORM=
|
||||
- RSS_URI=
|
||||
- SITEMAP_URI=
|
||||
volumes:
|
||||
- ./deno-fresh-app:/app
|
||||
- /app/node_modules
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
valkey:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- app_network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
public-mywebsite:
|
||||
build:
|
||||
context: ./backend/public
|
||||
dockerfile: Dockerfile
|
||||
container_name: public-mywebsite
|
||||
ports:
|
||||
- "3000:3000"
|
||||
# fill these in with public env vars for prod
|
||||
environment:
|
||||
- DATABASE_URL=
|
||||
- REDIS_URL=
|
||||
- BASE_URI_WEB=
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
valkey:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- app_network
|
||||
# make sure to change the url too
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
task-mywebsite:
|
||||
build:
|
||||
context: ./backend/task
|
||||
dockerfile: Dockerfile
|
||||
container_name: task-mywebsite
|
||||
# fill these in with task env vars for prod
|
||||
environment:
|
||||
- DATABASE_URL=
|
||||
- BASE_URI_API=
|
||||
- S3_ACCESS_KEY=
|
||||
- S3_SECRET_KEY=
|
||||
- S3_BUCKET=
|
||||
- REDIS_URL=
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
valkey:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- ./backend/task/app:/app # <<< place all markdown files here
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- app_network
|
||||
healthcheck:
|
||||
test: ["CMD", "pgrep", "-f", "task-mywebsite"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
networks:
|
||||
app_network:
|
||||
driver: bridge
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.20.0.0/16
|
||||
|
||||
volumes:
|
||||
valkey_mywebsite_data:
|
||||
driver: local
|
||||
postgres_mywebsite_data:
|
||||
driver: local
|
Reference in New Issue
Block a user