diff --git a/app/config/database.php b/app/config/database.php index 56058f83..4325e127 100644 --- a/app/config/database.php +++ b/app/config/database.php @@ -9,7 +9,7 @@ class DATABASE_CONFIG { var $default = array( 'driver' => 'mysql', 'persistent' => false, - 'host' => '172.17.0.1', + 'host' => 'db', 'login' => 'cmc', 'password' => 'xVRQI&cA?7AU=hqJ!%au', 'database' => 'cmc', diff --git a/build_docker.sh b/build_docker.sh index 0267e4ae..5e91e293 100644 --- a/build_docker.sh +++ b/build_docker.sh @@ -1,3 +1,3 @@ ID=$(docker ps -f ancestor=cmc:latest -q) docker kill $ID -docker build . -t "cmc:latest" +docker build . -t "cmc:latest" --platform linux/amd64 diff --git a/conf/nginx-site.conf b/conf/nginx-site.conf new file mode 100644 index 00000000..92dce82e --- /dev/null +++ b/conf/nginx-site.conf @@ -0,0 +1,14 @@ +server { + server_name cmclocal; + auth_basic_user_file /etc/nginx/userpasswd; + auth_basic "Restricted"; + location / { + proxy_pass http://cmc:80; + proxy_read_timeout 300s; + } + + listen 0.0.0.0:80; +# include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot +# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index caa61d6e..a08b2d0e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,9 +3,9 @@ services: image: nginx:latest hostname: nginx ports: - - "8888:80" # Expose HTTP traffic + - "80:80" # Expose HTTP traffic volumes: - - ./conf/nginx.conf:/etc/nginx/conf.d/cmc.conf + - ./conf/nginx-site.conf:/etc/nginx/conf.d/cmc.conf # todo setup site config. - ./userpasswd:/etc/nginx/userpasswd:ro depends_on: