gawa/docker-compose.yml

68 lines
1.6 KiB
YAML
Raw Normal View History

2023-05-29 02:21:31 +02:00
services:
db:
image: mariadb
ports:
- 3306:3306
environment:
2023-09-26 22:44:29 +02:00
# MYSQL_DATABASE: gawa
# MYSQL_USER: gawa
# MYSQL_PASSWORD: changethisforprod
2023-05-29 02:21:31 +02:00
MYSQL_ROOT_PASSWORD: root
volumes:
2023-10-02 10:23:03 +02:00
# - db_data:/var/lib/mysql
2023-09-26 22:44:29 +02:00
- ./docker/db/scripts:/docker-entrypoint-initdb.d/
2023-06-06 00:24:53 +02:00
2023-09-25 23:34:26 +02:00
main:
build: ./docker/main
2023-10-02 10:23:03 +02:00
command: bash -c "echo 'setting django up'
2023-10-08 19:46:12 +02:00
&& python manage.py makemessages --all
&& python manage.py compilemessages
2023-09-27 21:34:46 +02:00
&& python manage.py collectstatic --noinput
2023-10-08 19:46:12 +02:00
&& python manage.py check
&& echo 'waiting a few seconds for database to start'
&& sleep 1
2023-10-02 10:23:03 +02:00
&& python manage.py migrate
2023-10-08 19:46:12 +02:00
&& python manage.py createcachetable
2023-10-02 10:23:03 +02:00
&& DJANGO_SUPERUSER_PASSWORD='root' python manage.py createsuperuser\
2023-10-02 11:30:52 +02:00
--username root --noinput --email software@cscherr.de || true
2023-09-27 22:23:13 +02:00
&& python manage.py runserver 0.0.0.0:80
2023-09-27 21:34:46 +02:00
"
2023-05-29 02:21:31 +02:00
volumes:
- ./gawa:/app
environment:
- MARIADB_NAME=gawa
- MARIADB_USER=gawa
- MARIADB_PASSWORD=changethisforprod
depends_on:
- db
2023-06-06 00:24:53 +02:00
2023-09-25 23:34:26 +02:00
caddy:
image: caddy
restart: unless-stopped
2023-06-06 00:24:53 +02:00
ports:
2023-09-25 23:34:26 +02:00
- "80:80"
- "8081:8081"
# - "443:443"
# - "443:443/udp"
volumes:
- $PWD/docker/caddy/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
- ./gawa/static:/srv/static
- ./gawa/media:/srv/media
db-admin:
2023-05-29 02:21:31 +02:00
image: phpmyadmin
ports:
2023-09-25 23:34:26 +02:00
- 8080:80
2023-05-29 02:21:31 +02:00
environment:
- PMA_HOST=db
2023-09-25 23:34:26 +02:00
- PMA_ABSOLUTE_URI=http://localhost:8080
2023-09-26 22:44:29 +02:00
depends_on:
- db
2023-05-29 02:21:31 +02:00
2023-09-25 23:34:26 +02:00
volumes:
caddy_data:
caddy_config:
2023-10-02 10:23:03 +02:00
# db_data: