From d0288d3cc9ac2f5fab80e4837f0f9399c1de43b5 Mon Sep 17 00:00:00 2001 From: alban Date: Thu, 5 Nov 2020 16:50:20 +0100 Subject: [PATCH] [fix] Reworks Docker --- server/Dockerfile => Dockerfile | 4 ++-- server/.env.template | 3 +++ server/docker-compose.yml | 7 +++---- 3 files changed, 8 insertions(+), 6 deletions(-) rename server/Dockerfile => Dockerfile (81%) create mode 100644 server/.env.template diff --git a/server/Dockerfile b/Dockerfile similarity index 81% rename from server/Dockerfile rename to Dockerfile index c6c5ba1..6a66d92 100644 --- a/server/Dockerfile +++ b/Dockerfile @@ -15,10 +15,10 @@ RUN rm -f /etc/nginx/sites-enabled/* RUN pip3 install flask numpy pillow redis RUN pip3 install pypotrace -COPY ./files/nginx/sites-enabled/site.conf /etc/nginx/sites-enabled +COPY ./server/files/nginx/sites-enabled/site.conf /etc/nginx/sites-enabled COPY . . -COPY entrypoint.sh /usr/bin/ +COPY ./server/entrypoint.sh /usr/bin/ RUN chmod +x /usr/bin/entrypoint.sh EXPOSE 80 diff --git a/server/.env.template b/server/.env.template new file mode 100644 index 0000000..b8d8062 --- /dev/null +++ b/server/.env.template @@ -0,0 +1,3 @@ +DB_HOST="127.0.0.1" +DB_PORT="6379" +DEBUG=1 diff --git a/server/docker-compose.yml b/server/docker-compose.yml index fd3dbb6..a895080 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -16,13 +16,13 @@ services: app: env_file: .env - build: . + build: ../ image: teamlaser/laser-app:latest ports: - "5000:5000" depends_on: - db - command: python ./server.py + command: python /opt/server.py assets: env_file: .env @@ -35,9 +35,8 @@ services: worker: env_file: .env - build: . image: teamlaser/laser-app:latest depends_on: - db - command: bash -c "while true; do python ./worker.py; sleep 3; done" + command: bash -c "while true; do python /opt/worker.py; sleep 3; done"