Split prod dev and ssl docker-compose files
This commit is contained in:
@@ -11,7 +11,7 @@ check_installed docker-compose
|
||||
check_installed yarn
|
||||
check_installed mvn
|
||||
|
||||
docker-compose down
|
||||
docker-compose -f docker-compose.yml -f docker-compose.prod.yml down
|
||||
|
||||
# Generate Nuxt.js static website
|
||||
pushd frontend || exit 1
|
||||
@@ -23,4 +23,4 @@ pushd api || exit 1
|
||||
mvn clean package
|
||||
popd || exit 1
|
||||
|
||||
docker-compose up -d --build
|
||||
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
version: '2.2'
|
||||
|
||||
services:
|
||||
|
||||
db:
|
||||
ports:
|
||||
- 3306:3306
|
||||
@@ -0,0 +1,33 @@
|
||||
version: '2.2'
|
||||
|
||||
services:
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
container_name: notes-nginx
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Brussels
|
||||
volumes:
|
||||
- ./frontend/dist:/usr/share/nginx/html
|
||||
- ./nginx:/etc/nginx/conf.d
|
||||
- ./data/certbot/conf:/etc/letsencrypt
|
||||
- ./data/certbot/www:/var/www/certbot
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
depends_on:
|
||||
- api
|
||||
|
||||
api:
|
||||
build: ./api
|
||||
container_name: notes-api
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- TZ=Europe/Brussels
|
||||
- MYSQL_HOST=db
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
@@ -0,0 +1,9 @@
|
||||
version: '2.2'
|
||||
|
||||
services:
|
||||
|
||||
certbot:
|
||||
image: certbot/certbot
|
||||
volumes:
|
||||
- ./data/certbot/conf:/etc/letsencrypt
|
||||
- ./data/certbot/www:/var/www/certbot
|
||||
@@ -2,24 +2,6 @@ version: '2.2'
|
||||
|
||||
services:
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
container_name: notes-nginx
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Brussels
|
||||
volumes:
|
||||
- ./frontend/dist:/usr/share/nginx/html
|
||||
- ./nginx:/etc/nginx/conf.d
|
||||
- ./data/certbot/conf:/etc/letsencrypt
|
||||
- ./data/certbot/www:/var/www/certbot
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
depends_on:
|
||||
- api
|
||||
|
||||
db:
|
||||
image: mariadb
|
||||
container_name: notes-mariadb
|
||||
@@ -36,18 +18,5 @@ services:
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
|
||||
|
||||
api:
|
||||
build: ./api
|
||||
container_name: notes-api
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- TZ=Europe/Brussels
|
||||
- MYSQL_HOST=db
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
notes-db-volume:
|
||||
|
||||
+2
-2
@@ -10,11 +10,11 @@ check_installed() {
|
||||
check_installed docker-compose
|
||||
check_installed yarn
|
||||
|
||||
docker-compose stop nginx
|
||||
docker-compose -f docker-compose.yml -f docker-compose.prod.yml stop nginx
|
||||
|
||||
# Generate Nuxt.js static website
|
||||
pushd frontend || exit 1
|
||||
yarn run generate
|
||||
popd || exit 1
|
||||
|
||||
docker-compose up -d --build nginx
|
||||
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build nginx
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
check_installed() {
|
||||
if ! [ -x "$(command -v $1)" ]; then
|
||||
echo "Error: $1 is not installed." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_installed docker-compose
|
||||
|
||||
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build
|
||||
Reference in New Issue
Block a user