forked from agusmakmun/django-markdown-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 722 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM alpine:3.16.0
WORKDIR /app
# Install required packages including tini
RUN set -xe && \
apk add --no-cache python3 py3-pip tini && \
pip install --upgrade pip setuptools-scm
# Copy project files
COPY . .
# Install Python dependencies and setup Django app
RUN python3 setup.py install && \
python3 martor_demo/manage.py makemigrations && \
python3 martor_demo/manage.py migrate
# Create user and set permissions
RUN addgroup -g 1000 appuser && \
adduser -u 1000 -G appuser -D -h /app appuser && \
chown -R appuser:appuser /app
USER appuser
EXPOSE 8000/tcp
# Use full path for tini
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["python3", "/app/martor_demo/manage.py", "runserver", "0.0.0.0:8000"]