mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-22 15:21:01 +00:00
cb26d78d36
This fixes the issue where `docker-compose` fails to build takahe:latest container. The cause of issue is the build context for docker compose is different from the one of `docker build`. Currently, `make image` uses the repository root as a build context while `make compose_up` will use `docker/` directory as a build context. That's why docker-compose couldn't find the required files during building.
58 lines
1.2 KiB
YAML
58 lines
1.2 KiB
YAML
version: "3.4"
|
|
|
|
# DO NOT USE THIS IN PRODUCTION - it is for development only due to insecure
|
|
# settings and the use of "runserver" versus "gunicorn".
|
|
# See https://takahe-server.readthedocs.io/en/latest/installation.html for more
|
|
|
|
x-takahe-common:
|
|
&takahe-common
|
|
build:
|
|
context: ..
|
|
dockerfile: ./docker/Dockerfile
|
|
|
|
image: takahe:latest
|
|
environment:
|
|
DJANGO_SETTINGS_MODULE: takahe.settings.development
|
|
PGHOST: db
|
|
PGDATABASE: takahe
|
|
PGUSER: postgres
|
|
PGPASSWORD: insecure_password
|
|
networks:
|
|
- external_network
|
|
- internal_network
|
|
restart: on-failure
|
|
depends_on:
|
|
- db
|
|
volumes:
|
|
- ..:/takahe/
|
|
|
|
services:
|
|
db:
|
|
image: postgres:15-alpine
|
|
healthcheck:
|
|
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
|
volumes:
|
|
- dbdata:/var/lib/postgresql/data
|
|
networks:
|
|
- internal_network
|
|
restart: always
|
|
environment:
|
|
POSTGRES_DB: takahe
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: insecure_password
|
|
|
|
web:
|
|
<<: *takahe-common
|
|
ports:
|
|
- "8000:8000"
|
|
|
|
setup:
|
|
<<: *takahe-common
|
|
command: ["/takahe/manage.py", "migrate"]
|
|
|
|
networks:
|
|
internal_network:
|
|
external_network:
|
|
|
|
volumes:
|
|
dbdata:
|