-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (17 loc) · 917 Bytes
/
Dockerfile
File metadata and controls
23 lines (17 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM python:3.9.6-slim-buster
ARG PROJECT_NAME=building-emissions USR_NAME=jup PROJECT_PATH=/home/jup/building-emissions
RUN groupadd --gid 1000 ${USR_NAME} && \
useradd --uid 1000 ${USR_NAME} --gid ${USR_NAME} --shell /bin/bash --create-home && \
mkdir ${PROJECT_PATH} ${PROJECT_PATH}/src ${PROJECT_PATH}/src/data ${PROJECT_PATH}/src/modules ${PROJECT_PATH}/src/main && \
chown -R 1000:1000 ${PROJECT_PATH}
USER ${USR_NAME}:${USR_NAME}
RUN cd ${PROJECT_PATH} && \
/bin/bash -c \
"echo 'pip freeze > /home/jup/building-emissions/requirements.txt' | tee update.sh && \
ln -s update.sh update && \
echo 'creating python virtual environment' && \
python -m venv venv && \
ln -s venv/bin/activate jupdev"
ENV PATH "/home/jup/building-emissions:$PATH"
COPY --chown=${USR_NAME}:${USR_NAME} ./src/ ${PROJECT_PATH}/src/
COPY --chown=${USR_NAME}:${USR_NAME} ./requirements.txt ${PROJECT_PATH}/requirements.txt