-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 779 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (26 loc) · 779 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
29
30
31
32
33
34
35
36
FROM python:3.12-alpine
# Upgrade system
RUN apk update && apk upgrade
# Setup workspace
RUN mkdir -p /app/src /app/data /app/config
WORKDIR /app
# Install Python requirements
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
VOLUME "/app/data"
EXPOSE 5353
ARG UID=1000
RUN adduser user --uid ${UID} -S
RUN chown -R user /app
USER user
# Setup env vars for dockerized app
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
ENV LINKSHARER_CONFIG_PATH=/app/config
ENV LINKSHARER_DATA_PATH=/app/data
# Copy app sources and setup
COPY src/ src/
# Launch app
CMD [ "gunicorn", "-b", "0.0.0.0:5353", "src.linksharer:app" ]