There is now a /data directory that contains the location.db, both belonging to user app. This fixed permission issues and ensures that the app does not try to write in a ro docker layer.
18 lines
369 B
Docker
18 lines
369 B
Docker
FROM python:3.13
|
|
|
|
WORKDIR /usr/local/app
|
|
|
|
COPY server/requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY server/python_server.py ./python_server.py
|
|
|
|
EXPOSE 8080
|
|
|
|
RUN useradd app && mkdir /data && touch /data/location.db && chown -R app /dataa
|
|
VOLUME /data
|
|
|
|
USER app
|
|
|
|
CMD ["gunicorn", "-w", "4", "python_server:app", "--bind", "0.0.0.0:8080"]
|