Dockerises the app!

This commit is contained in:
2025-06-03 07:27:19 +01:00
parent 077d33d801
commit d404a0097f
10 changed files with 110 additions and 81 deletions

View File

@@ -1,25 +1,26 @@
networks:
app-network:
driver: bridge
services:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-16}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${POSTGRES_USER:-app}
healthcheck:
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
timeout: 5s
retries: 5
start_period: 60s
phpfpm:
build: .
volumes:
- database_data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###
- ./php-fpm:/opt/bitnami/php/etc/php-fpm.d
expose:
- 9000
networks:
- app-network
volumes:
###> doctrine/doctrine-bundle ###
database_data:
###< doctrine/doctrine-bundle ###
nginx:
image: 'docker.io/bitnami/nginx:1.28'
depends_on:
- phpfpm
networks:
- app-network
ports:
- '8080:8080'
- '443:443'
volumes:
- ./nginx:/opt/bitnami/nginx/conf/server_blocks
- ./symfony:/app