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
2
2
3
3
RUN apt update \
4
4
&& apt install -y \
@@ -14,8 +14,8 @@ ARG UID=1000
14
14
ARG GID=1000
15
15
16
16
# Set environment variables
17
- ENV USER ${USER}
18
- ENV HOME /home/${USER}
17
+ ENV USER= ${USER}
18
+ ENV HOME= /home/${USER}
19
19
20
20
# Create user and setup permissions on /etc/sudoers
21
21
RUN 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/
39
39
-p https://github.com/zsh-users/zsh-completions
40
40
41
41
USER user
42
-
43
- CMD zsh
Original file line number Diff line number Diff line change @@ -3,10 +3,14 @@ services:
3
3
build :
4
4
context : ./ # Use the current directory as the build context
5
5
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}
8
12
volumes :
9
- - ./:/home/user/workspace
13
+ - ./:/home/user/${REPO_NAME}
10
14
- ${HOME}/.gitconfig:/home/user/.gitconfig
11
15
- ${HOME}/.ssh:/home/user/.ssh
12
16
- ${HOME}/.zsh_history:/home/user/.zsh_history
@@ -16,12 +20,7 @@ services:
16
20
privileged : true # Grant full privileges to the container
17
21
ports :
18
22
- 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" ]
25
24
26
25
networks :
27
26
default :
You can’t perform that action at this time.
0 commit comments