weblate/dev-docker/docker-compose.yml
Paul Harriet Asiñero e9140b6737
feat(dev): Expose PostgreSQL when using the development Docker setup (#11684)
* Exposed the PostgreSQL container to port 5433
* Added entry on docs about the exposed port of PostgresSQL container
2024-05-22 08:20:46 +02:00

65 lines
1.5 KiB
YAML

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
version: '3'
##########
# WARNING!
# This docker-compose file is meant to be used in the development process
# and WILL perform very poorly in production.
#
# For production-ready docker-compose file see:
# https://github.com/WeblateOrg/docker-compose
#########
services:
weblate:
image: weblate-dev:latest
build:
context: ./weblate-dev/
args:
USER_ID: ${USER_ID}
GROUP_ID: ${GROUP_ID}
ports:
- ${WEBLATE_HOST}:8080
user: $USER_ID:$GROUP_ID
userns_mode: host
tmpfs:
- /app/cache:uid=$USER_ID,gid=$GROUP_ID
- /tmp:uid=$USER_ID,gid=$GROUP_ID,exec
- /run:uid=$USER_ID,gid=$GROUP_ID
volumes:
# Local data directory
- $PWD/data:/app/data
# Override Weblate with local dir
- $PWD/../weblate:/app/venv/lib/python${DOCKER_PYTHON}/site-packages/weblate
restart: always
depends_on:
- database
- cache
environment:
DJANGO_SETTINGS_MODULE: weblate.settings_docker
WEBLATE_SITE_DOMAIN: ${WEBLATE_HOST}
env_file:
- ./environment
database:
image: postgres:16-alpine
env_file:
- ./environment
volumes:
- postgres-data:/var/lib/postgresql/data
- ./postgres-init:/docker-entrypoint-initdb.d
restart: always
ports:
- 5433:5432
cache:
image: redis:7-alpine
restart: always
command: [redis-server, --save, '60', '1']
volumes:
- redis-data:/data
volumes:
weblate-data: {}
postgres-data: {}
redis-data: {}