Skip to content

Commit 9dfc0ae

Browse files
committed
Docker update
1 parent a30d590 commit 9dfc0ae

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# syntax=docker/dockerfile:1
22

33
# Build the application from source
4-
FROM golang:1.22-alpine AS build
4+
FROM golang:1.23-alpine AS build
55

66
# Set destination for COPY
77
WORKDIR /app
88

99
# Download Go modules
10-
COPY go.mod ./
10+
COPY go.mod go.sum ./
1111
RUN go mod download
1212

1313
# Copy the source code. Note the slash at the end, as explained in

docker-compose.yml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
version: '3.8'
21
services:
3-
db:
4-
image: postgres:15
5-
environment:
6-
- POSTGRES_USER=postgres
7-
- POSTGRES_PASSWORD=password
8-
volumes:
9-
- postgres-db-volume:/var/lib/postgresql/data
10-
ports:
11-
- 5432:5432
12-
networks:
13-
- postgres-db-network
14-
server:
15-
build: .
16-
environment:
17-
- POSTGRES=db:5432
18-
- POSTGRES_USER=postgres
19-
- POSTGRES_PASSWORD=password
20-
ports:
21-
- 8080:8080
22-
networks:
23-
- postgres-db-network
2+
db:
3+
image: postgres:17
4+
ports:
5+
- 2345:5432
6+
environment:
7+
POSTGRES_USER: trailcompass
8+
POSTGRES_PASSWORD: trailcompass
9+
POSTGRES_DB: trailcompass
10+
volumes:
11+
- postgres-db-volume:/var/lib/postgresql/data
12+
healthcheck:
13+
test: ["CMD", "pg_isready", "-U", "trailcompass"]
14+
interval: 5s
15+
retries: 5
16+
restart: always
17+
networks:
18+
- postgres-db-network
19+
server:
20+
build: .
21+
environment:
22+
- POSTGRES=db:2345
23+
- POSTGRES_USER=trailcompass
24+
- POSTGRES_PASSWORD=trailcompass
25+
ports:
26+
- 8080:8080
27+
networks:
28+
- postgres-db-network
2429

2530
volumes:
2631
postgres-db-volume:

0 commit comments

Comments
 (0)