File tree Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change 1- CONTAINER_NAME = OOP
1+ CONTAINER_NAME = oop
2+ IMAGE_NAME = oop
3+ REPO_NAME = oop
Original file line number Diff line number Diff line change 1- FROM python:3.12
1+ FROM python:3.12-slim
22
33RUN apt update \
44 && apt install -y \
@@ -14,8 +14,8 @@ ARG UID=1000
1414ARG GID=1000
1515
1616# Set environment variables
17- ENV USER ${USER}
18- ENV HOME /home/${USER}
17+ ENV USER= ${USER}
18+ ENV HOME= /home/${USER}
1919
2020# Create user and setup permissions on /etc/sudoers
2121RUN useradd -m -s /bin/bash -N -u $UID $USER && \
@@ -39,5 +39,3 @@ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/
3939 -p https://github.com/zsh-users/zsh-completions
4040
4141USER user
42-
43- CMD zsh
Original file line number Diff line number Diff line change @@ -3,10 +3,14 @@ services:
33 build :
44 context : ./ # Use the current directory as the build context
55 dockerfile : Dockerfile
6- hostname : debian
7- container_name : ${CONTAINER_NAME} # defined in .env file
6+ image : ${IMAGE_NAME}
7+ hostname : ${CONTAINER_NAME}
8+ container_name : ${CONTAINER_NAME}
9+ environment :
10+ - REPO_NAME=${REPO_NAME}
11+ working_dir : /home/user/${REPO_NAME}
812 volumes :
9- - ./:/home/user/workspace
13+ - ./:/home/user/${REPO_NAME}
1014 - ${HOME}/.gitconfig:/home/user/.gitconfig
1115 - ${HOME}/.ssh:/home/user/.ssh
1216 - ${HOME}/.zsh_history:/home/user/.zsh_history
@@ -16,12 +20,7 @@ services:
1620 privileged : true # Grant full privileges to the container
1721 ports :
1822 - 8888:8888
19- command :
20- [
21- " bash" ,
22- " -c" ,
23- " sudo chown user:root --recursive /home/user/ && zsh && tail -f /dev/null" ,
24- ]
23+ command : [ "sh", "-c", "sudo chown user --recursive /home/user; zsh && tail -f /dev/null" ]
2524
2625networks :
2726 default :
You can’t perform that action at this time.
0 commit comments