fixed permissions for db.sqlite3
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
venv
|
||||
.venv
|
||||
__pycache__
|
||||
.idea
|
||||
+13
-3
@@ -1,11 +1,13 @@
|
||||
# Use the official Python runtime image
|
||||
FROM python:3.13-alpine
|
||||
#COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
|
||||
# Disable development dependencies
|
||||
#ENV UV_NO_DEV=1
|
||||
|
||||
# Create the app directory
|
||||
RUN mkdir /app
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /app
|
||||
|
||||
# Create a non-privileged user that the app will run under.
|
||||
# See https://docs.docker.com/go/dockerfile-user-best-practices/
|
||||
@@ -34,6 +36,8 @@ ENV PIP_ROOT_USER_ACTION=ignore
|
||||
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
|
||||
# Leverage a bind mount to requirements.txt to avoid having to copy them into
|
||||
# into this layer.
|
||||
# using pip (uv is below)
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
--mount=type=bind,source=requirements.txt,target=/requirements.txt \
|
||||
python -m pip install -r /requirements.txt
|
||||
@@ -41,6 +45,8 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
## run this command to install all dependencies
|
||||
#RUN pip install --no-cache-dir -r requirements.txt
|
||||
##RUN pip install --no-cache-dir django-tailwind
|
||||
|
||||
RUN chown appuser:appuser /app
|
||||
|
||||
# Switch to the non-privileged user to run the application.
|
||||
USER appuser
|
||||
@@ -55,7 +61,11 @@ COPY --chown=appuser:appuser manage.py db.sqlite3 /app/
|
||||
|
||||
# Expose the Django port
|
||||
EXPOSE 8000
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /app
|
||||
|
||||
#RUN uv sync --locked
|
||||
|
||||
# Run Django’s development server
|
||||
CMD ["python", "manage.py", "migrate"]
|
||||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|
||||
|
||||
Reference in New Issue
Block a user