[fix] Reworks Docker

This commit is contained in:
alban 2020-11-05 16:50:20 +01:00
parent d1f1c32c03
commit d0288d3cc9
3 changed files with 8 additions and 6 deletions

View File

@ -15,10 +15,10 @@ RUN rm -f /etc/nginx/sites-enabled/*
RUN pip3 install flask numpy pillow redis RUN pip3 install flask numpy pillow redis
RUN pip3 install pypotrace 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 . .
COPY entrypoint.sh /usr/bin/ COPY ./server/entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh RUN chmod +x /usr/bin/entrypoint.sh
EXPOSE 80 EXPOSE 80

3
server/.env.template Normal file
View File

@ -0,0 +1,3 @@
DB_HOST="127.0.0.1"
DB_PORT="6379"
DEBUG=1

View File

@ -16,13 +16,13 @@ services:
app: app:
env_file: .env env_file: .env
build: . build: ../
image: teamlaser/laser-app:latest image: teamlaser/laser-app:latest
ports: ports:
- "5000:5000" - "5000:5000"
depends_on: depends_on:
- db - db
command: python ./server.py command: python /opt/server.py
assets: assets:
env_file: .env env_file: .env
@ -35,9 +35,8 @@ services:
worker: worker:
env_file: .env env_file: .env
build: .
image: teamlaser/laser-app:latest image: teamlaser/laser-app:latest
depends_on: depends_on:
- db - 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"