Files
17th-Battalion-Tracker/docker-compose.yaml
IndigoFox 9f2473801c Initial commit
TODO: change api.conf URL references to use environment variables and add these variables to the docker-compose configuration for host domain
2023-03-28 00:08:50 -07:00

64 lines
1.6 KiB
YAML

version: '3.8'
name: 17thrangers
services:
db:
env_file: .env
image: mysql
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
# (this is just an example, not intended to be a production configuration)
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
volumes:
- ./mysql:/var/lib/mysql
ports:
- 12730:3306
api:
env_file: .env
build:
context: ./api
dockerfile: Dockerfile
# use bind mount - make sure you go to ./api and run npm i first
volumes:
- ./api:/app
command: npm run dev
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
restart: always
ports:
- 3000:3000
depends_on:
- db
# get self-signed cert
nginx:
env_file: .env
image: nginx:latest
restart: always
ports:
- 9229:9229
- 9230:9230
volumes:
- ./nginx/conf/:/etc/nginx/conf.d
# - ./certbot/www:/var/www/certbot/:ro
# - ./certbot/conf/:/etc/nginx/ssl/:ro
# my implementation, already have another primary instance
- /home/certbot/www:/var/www/certbot/:ro
- /home/certbot/conf/:/etc/nginx/ssl/:ro
depends_on:
- api
certbot:
image: certbot/certbot:latest
volumes:
- ./certbot/www/:/var/www/certbot/:rw
- ./certbot/conf/:/etc/letsencrypt/:rw