-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-dev
More file actions
49 lines (32 loc) · 1 KB
/
Dockerfile-dev
File metadata and controls
49 lines (32 loc) · 1 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.8
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
RUN apt-get update -y \
&& apt-get install -y python3-dev python3-pip build-essential \
&& apt-get install gcc -y \
&& apt-get clean
ARG USER_ID=1000
ARG GROUP_ID=1000
# Set user and group
ARG user=ciao
ARG group=kabum
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} ${group}
RUN useradd -u ${uid} -g ${group} -s /bin/sh -m ${user} # <--- the '-m' create a user home directory
# Switch to user
USER ${uid}
WORKDIR /home/${uid}
COPY requirements.txt requirements.txt
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
COPY . /home/${uid}
ENV PYTHONPATH "${PYTHONPATH}:/workspaces/ciao"
EXPOSE 5000
EXPOSE 3306
ENV FLASK_APP=/workspaces/backoffice-backend-ciao/src/app.py
ENV SHELL /bin/bash
CMD ["bash", "python", "-m" , "flask", "run", "--host=0.0.0.0"]
# ENTRYPOINT ["/usr/bin/python", "app.py"]