diff --git a/.gitignore b/.gitignore index 62ca449..a811261 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ .venv/ static/* -!static/.gitkeep \ No newline at end of file +!static/.gitkeep + +containers/https-portal/ssl_certs/ \ No newline at end of file diff --git a/containers/https-portal/Dockerfile b/containers/https-portal/Dockerfile new file mode 100644 index 0000000..d05fe31 --- /dev/null +++ b/containers/https-portal/Dockerfile @@ -0,0 +1 @@ +FROM steveltn/https-portal:1 \ No newline at end of file diff --git a/containers/python/Dockerfile b/containers/store-manager/Dockerfile similarity index 100% rename from containers/python/Dockerfile rename to containers/store-manager/Dockerfile diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index d98aa47..360eba4 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,11 +1,11 @@ version: "3.9" services: - python: - container_name: python + store-manager: + container_name: store-manager build: context: . - dockerfile: containers/python/Dockerfile + dockerfile: containers/store-manager/Dockerfile volumes: - .:/code tty: true @@ -13,8 +13,8 @@ services: - .env.dev networks: - shared_network - image_web: - container_name: image_web + image-web: + container_name: image-web build: context: . dockerfile: containers/nginx/Dockerfile diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 7df96a1..58bd27a 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,19 +1,19 @@ version: "3.9" services: - python: - container_name: python + store-manager: + container_name: store-manager build: context: . - dockerfile: containers/python/Dockerfile + dockerfile: containers/store-manager/Dockerfile restart: unless-stopped volumes: - .:/code tty: true env_file: - .env.prod - image_web: - container_name: image_web + image-web: + container_name: image-web build: context: . dockerfile: containers/nginx/Dockerfile @@ -22,5 +22,20 @@ services: - ./static:/static ports: - 80:80 + ssl-web: + container_name: ssl-web + build: + context: . + dockerfile: containers/https-portal/Dockerfile + restart: unless-stopped + ports: + - 80:80 + - 443:443 + environment: + DOMAINS: 'tely-store.st.ie.u-ryukyu.ac.jp -> http://web:80' + STAGE: 'production' + #FORCE_RENEW: 'true' + volumes: + - ./containers/https-portal/ssl_certs:/var/lib/https-portal volumes: static: diff --git a/update.sh b/update.sh index ac84645..0fe0cdc 100755 --- a/update.sh +++ b/update.sh @@ -2,14 +2,14 @@ CURRENT_DIR=`cd $(dirname $0) && pwd` -container_id=`docker ps -q -f status=running -f name=python` +container_id=`docker ps -q -f status=running -f name=store-manager` if [ -z "$container_id" ]; then - echo "python is not running" + echo "store-manager is not running" exit 0 fi -docker exec -it python python src/main.py +docker exec -it store-manager python src/main.py docker-compose -f docker-compose.prod.yml down