Skip to content

Commit

Permalink
[#1] Setup docker
Browse files Browse the repository at this point in the history
  • Loading branch information
wayangalihpratama committed Aug 29, 2023
1 parent db47122 commit 7fea28d
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

COMPOSE_HTTP_TIMEOUT=180 docker compose \
-f docker-compose.yml \
-f docker-compose.override.yml \
-f docker-compose-docker-sync.yml "$@"
9 changes: 9 additions & 0 deletions docker-compose-docker-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
version: "3.9"
services:
frontend:
volumes:
- afs-docker-sync:/app/node_modules:nocopy
volumes:
afs-docker-sync:
external: true
36 changes: 36 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
version: "3.9"
services:
mainnetwork:
image: alpine:3.14
command: ["tail", "-f", "/dev/null"]
ports:
- 3000:3000
- 8000:8000
- 5050:5050
# backend debuger port
- 8888:8888
frontend:
network_mode: service:mainnetwork
volumes:
- ${STORAGE_PATH}/images:/app/public/images:delegated
backend:
environment:
- WEBDOMAIN=https://afs.akvotest.org
network_mode: service:mainnetwork
volumes:
- ${STORAGE_PATH}:/app/storage:delegated
pgadmin:
image: dpage/pgadmin4:5.7
environment:
- PGADMIN_LISTEN_PORT=5050
- [email protected]
- PGADMIN_DEFAULT_PASSWORD=password
volumes:
- ./pgadmin4/servers.json:/pgadmin4/servers.json
- pg-admin-data:/var/lib/pgadmin
depends_on:
- db
network_mode: service:mainnetwork
volumes:
pg-admin-data:
38 changes: 38 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
version: "3.9"
services:
backend:
image: python:3.8.5
working_dir: /app
command: ["./run.sh"]
volumes:
- ./backend:/app:delegated
environment:
- DB_USER=akvo
- DB_PASSWORD=password
- DB_HOST=db
- DEBUG=True
- DJANGO_SECRET=local-secret
- AFS_INSTANCE
- STORAGE_PATH
depends_on:
- db
frontend:
image: akvo/akvo-node-18-alpine:20220923.084347.0558ee6
command: ["./start.sh"]
volumes:
- ./frontend:/app:delegated
working_dir: /app
depends_on:
- backend
db:
image: postgres:12-alpine
volumes:
- ./db/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- pg-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=password
ports:
- 5432:5432
volumes:
pg-data:
5 changes: 5 additions & 0 deletions docker-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
version: "3.9"
syncs:
afs-docker-sync:
src: "./frontend/node_modules"
4 changes: 4 additions & 0 deletions storage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
./test
*.csv
*.xlsx
*/**

0 comments on commit 7fea28d

Please sign in to comment.