♻️ Add backend and frontend to docker-compose

This commit is contained in:
2023-05-26 17:57:09 +02:00
parent b3b36bc3de
commit c44a52b7ae
4 changed files with 50 additions and 7 deletions

26
backend/Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM python:3.11-slim as builder
WORKDIR /app
COPY . /app
RUN apt update && apt install -y proj-bin
RUN pip install --upgrade poetry && \
poetry config virtualenvs.create false && \
poetry install --only=main && \
poetry export -f requirements.txt >> requirements.txt
FROM python:3.11-slim as runtime
COPY . /app
COPY --from=builder /app/requirements.txt /app
RUN apt update && apt install -y postgresql libpq5
RUN pip install --no-cache-dir -r /app/requirements.txt
WORKDIR /app
ENV CONFIG_PATH=./config.sample.yaml
ENV API_KEY=MwP7lbljnXIYAnmmmPRzasHsIknaiKqD
CMD ["python", "./main.py"]