add docker compose file
This commit is contained in:
@@ -8,18 +8,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Python deps
|
# Python deps
|
||||||
COPY requirements.txt /app/requirements.txt
|
COPY transportmanager/requirements.txt /app/requirements.txt
|
||||||
RUN pip install --no-cache-dir -r /app/requirements.txt
|
RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||||
|
|
||||||
# App code
|
# App code
|
||||||
COPY server /app/server
|
COPY transportmanager/server /app/server
|
||||||
COPY client /app/client
|
COPY transportmanager/client /app/client
|
||||||
|
|
||||||
# Nginx config
|
# Nginx config
|
||||||
COPY deploy/nginx.conf /etc/nginx/nginx.conf
|
COPY transportmanager/deploy/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# Supervisor config
|
# Supervisor config
|
||||||
COPY deploy/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY transportmanager/deploy/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|
||||||
# Nginx needs a pid file path
|
# Nginx needs a pid file path
|
||||||
RUN mkdir -p /var/run/nginx
|
RUN mkdir -p /var/run/nginx
|
||||||
@@ -33,9 +33,5 @@ ENV TZ=Europe/Bucharest \
|
|||||||
# Expose only 80 internally (for nginx)
|
# Expose only 80 internally (for nginx)
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Healthcheck (API ping)
|
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --retries=5 CMD \
|
|
||||||
wget -qO- http://127.0.0.1/api/health || exit 1
|
|
||||||
|
|
||||||
# Run all processes via supervisor
|
# Run all processes via supervisor
|
||||||
CMD ["/usr/bin/supervisord","-c","/etc/supervisor/conf.d/supervisord.conf"]
|
CMD ["/usr/bin/supervisord","-c","/etc/supervisor/conf.d/supervisord.conf"]
|
||||||
26
transportmanager/docker-compose.yml
Normal file
26
transportmanager/docker-compose.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
tms:
|
||||||
|
build:
|
||||||
|
context: . # repo root (where transportmanager/ lives)
|
||||||
|
dockerfile: transportmanager/Dockerfile
|
||||||
|
image: tms:latest
|
||||||
|
container_name: tms
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- VIRTUAL_HOST=tms.northdanubesoft.eu
|
||||||
|
- LETSENCRYPT_HOST=tms.northdanubesoft.eu
|
||||||
|
- VIRTUAL_PORT=80
|
||||||
|
- TZ=Europe/Bucharest
|
||||||
|
networks:
|
||||||
|
- reverse-proxy
|
||||||
|
volumes:
|
||||||
|
- tms_sqlite:/app/server/instance
|
||||||
|
|
||||||
|
networks:
|
||||||
|
reverse-proxy:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
tms_sqlite:
|
||||||
Reference in New Issue
Block a user