[fix] Reworks Docker
This commit is contained in:
parent
d1f1c32c03
commit
d0288d3cc9
3 changed files with 8 additions and 6 deletions
3
server/.env.template
Normal file
3
server/.env.template
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
DB_HOST="127.0.0.1"
|
||||
DB_PORT="6379"
|
||||
DEBUG=1
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
FROM python:3.8-slim
|
||||
LABEL name=laser-app version=0.1
|
||||
|
||||
WORKDIR /opt
|
||||
RUN apt update
|
||||
RUN apt install -y --no-install-recommends build-essential\
|
||||
gcc\
|
||||
libagg2-dev\
|
||||
libpotrace-dev\
|
||||
nginx-light\
|
||||
pkg-config\
|
||||
python-dev\
|
||||
redis-server
|
||||
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 . .
|
||||
|
||||
COPY entrypoint.sh /usr/bin/
|
||||
RUN chmod +x /usr/bin/entrypoint.sh
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 5000
|
||||
EXPOSE 9001
|
||||
|
||||
# Start the main process.
|
||||
CMD ["python", "./server.py", "-i", "db"]
|
||||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue