Skip to content

Commit eb70852

Browse files
committed
add docker-compose
1 parent 53e922d commit eb70852

File tree

4 files changed

+533
-76
lines changed

4 files changed

+533
-76
lines changed

.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONTAINER_NAME=OOP

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10
1+
FROM python:3.12
22

33
RUN apt update \
44
&& apt install -y \

docker-compose.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
services:
2+
container:
3+
build:
4+
context: ./ # Use the current directory as the build context
5+
dockerfile: Dockerfile
6+
hostname: debian
7+
container_name: ${CONTAINER_NAME} # defined in .env file
8+
volumes:
9+
- ./:/home/user/workspace
10+
- ${HOME}/.gitconfig:/home/user/.gitconfig
11+
- ${HOME}/.ssh:/home/user/.ssh
12+
- ${HOME}/.zsh_history:/home/user/.zsh_history
13+
- ${HOME}/.kattisrc:/home/user/.kattisrc
14+
cap_add:
15+
- ALL
16+
privileged: true # Grant full privileges to the container
17+
ports:
18+
- 8888:8888
19+
command:
20+
[
21+
"bash",
22+
"-c",
23+
"sudo chown user:root --recursive /home/user/ && zsh && tail -f /dev/null",
24+
]
25+
26+
networks:
27+
default:
28+
driver: bridge

0 commit comments

Comments
 (0)