File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM golang:1.19-alpine
2
+
3
+ RUN mkdir /app
4
+
5
+ ADD . /app
6
+
7
+ WORKDIR /app
8
+
9
+ RUN go build -o main cmd/main.go
10
+
11
+ CMD ["/app/main" ]
Original file line number Diff line number Diff line change
1
+ version : " 3.8"
2
+
3
+ services :
4
+ web :
5
+ build :
6
+ context : .
7
+ dockerfile : Dockerfile
8
+ image : app
9
+ container_name : app
10
+ restart : unless-stopped
11
+ env_file : .env
12
+ ports :
13
+ - " $PORT:$PORT"
14
+ depends_on :
15
+ - mongodb
16
+
17
+ mongodb :
18
+ image : mongo:6.0
19
+ container_name : mongodb
20
+ restart : unless-stopped
21
+ env_file : .env
22
+ environment :
23
+ - MONGO_INITDB_ROOT_USERNAME=$DB_USER
24
+ - MONGO_INITDB_ROOT_PASSWORD=$DB_PASS
25
+ - MONGO_INITDB_DATABASE=$DB_NAME
26
+ ports :
27
+ - " $DB_PORT:$DB_PORT"
28
+ volumes :
29
+ - dbdata:/data/db
30
+
31
+ volumes :
32
+ dbdata :
You can’t perform that action at this time.
0 commit comments