Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM php:7.3-fpm-alpine
FROM composer:latest as packages
WORKDIR /app
COPY ${PWD}/src /app/
RUN composer install --ignore-platform-reqs --no-scripts --no-interaction --prefer-dist --optimize-autoloader

FROM php:7.3-fpm-alpine as runtime
WORKDIR /var/www

COPY --from=packages --chown=www-data:www-data /app/ /var/www/
RUN chown -R www-data:www-data /var/www

CMD ["php-fpm"]
20 changes: 20 additions & 0 deletions configs/nginx.app.local.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server {
index index.php index.html;
root /var/www/public;

location / {
try_files $uri /index.php?$args;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param APP_DEBUG true;
}

listen 80;
}
18 changes: 18 additions & 0 deletions docker-compose.deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3'
services:
# The Application
app:
env_file: ./src/.env

# The Web Server
web:
volumes:
- ./configs/nginx.app.conf:/etc/nginx/conf.d/default.conf
- /etc/letsencrypt/:/etc/letsencrypt/
ports:
- 443:443
# The Database
databases:
env_file: ./src/.env
volumes:
dbdata:
16 changes: 16 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3'
services:
# The Application
app:
env_file: ./src/.env.example

# The Web Server
web:
volumes:
- ./configs/nginx.app.local.conf:/etc/nginx/conf.d/default.conf
ports:
- 80:80

# The Database
database:
env_file: ./src/.env.example
17 changes: 8 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ services:
context: ./
dockerfile: Dockerfile
working_dir: /var/www
volumes:
- ./src:/var/www
env_file: ./src/.env
# volumes:
# - ./src:/var/www
#env_file: ./src/.env
environment:
- "DB_PORT=5984"
- "DB_HOST=database"
Expand All @@ -18,23 +18,22 @@ services:
# The Web Server
web:
image: nginx:1.15
working_dir: /var/www
#working_dir: /var/www
volumes:
- ./src:/var/www
#- ./src:/var/www
- ./configs/nginx.app.conf:/etc/nginx/conf.d/default.conf
- /etc/letsencrypt/:/etc/letsencrypt/
#- /etc/letsencrypt/:/etc/letsencrypt/
ports:
- 80:80
- 443:443
# The Database
database:
image: couchdb:latest
volumes:
- dbdata:/opt/couchdb/data
- ./configs/couch.local.ini:/opt/couchdb/etc/local.ini
env_file: ./src/.env
# env_file: ./src/.env
ports:
- "5984:5984"

volumes:
dbdata:
dbdata: