Skip to content

Commit b4e1f1e

Browse files
committed
update readme and docker-compose
1 parent 0b26d80 commit b4e1f1e

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
CONTAINER_NAME=OOP
1+
CONTAINER_NAME=oop
2+
IMAGE_NAME=oop
3+
REPO_NAME=oop

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12
1+
FROM python:3.12-slim
22

33
RUN apt update \
44
&& apt install -y \
@@ -14,8 +14,8 @@ ARG UID=1000
1414
ARG 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
2121
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/
3939
-p https://github.com/zsh-users/zsh-completions
4040

4141
USER user
42-
43-
CMD zsh

docker-compose.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff 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

2625
networks:
2726
default:

0 commit comments

Comments
 (0)