Skip to content

Commit bf6abfa

Browse files
Add compose files for local development
1 parent fb4f990 commit bf6abfa

File tree

4 files changed

+59
-7
lines changed

4 files changed

+59
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ run-dev: docs build
1919

2020
build-image: docs
2121
echo "Building ${IMAGE_NAME}:${IMAGE_TAG} image...";
22-
docker image build -t ${IMAGE_NAME}:${IMAGE_TAG} .;
22+
docker build -f arm.Dockerfile -t ${IMAGE_NAME}:${IMAGE_TAG} .;
2323
echo "Image ${IMAGE_NAME}:${IMAGE_TAG} built.";
2424

2525
deploy:

arm.Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM golang:1.22
2+
3+
WORKDIR /app
4+
5+
COPY go.mod go.sum ./
6+
RUN go mod download
7+
COPY . ./
8+
9+
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o bin/api cmd/main.go
10+
11+
EXPOSE 8090
12+
13+
CMD ["./bin/api"]

docker-compose.local.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: '3.9'
2+
3+
services:
4+
postgres:
5+
image: postgres:16
6+
container_name: approved-db
7+
ports:
8+
- "5434:5432"
9+
env_file:
10+
- .env.db
11+
healthcheck:
12+
test: ["CMD-SHELL", "pg_isready -U approved"]
13+
interval: 10s
14+
timeout: 3s
15+
retries: 3
16+
volumes:
17+
- postgres_data:/var/lib/postgresql/data
18+
networks:
19+
- app-network
20+
21+
rabbitmq:
22+
image: rabbitmq:management
23+
container_name: approved-mq
24+
ports:
25+
- "5672:5672"
26+
- "15672:15672"
27+
healthcheck:
28+
test: [ "CMD", "rabbitmqctl", "status" ]
29+
interval: 30s
30+
timeout: 10s
31+
retries: 5
32+
volumes:
33+
- rabbitmqdata:/var/lib/rabbitmq
34+
networks:
35+
- app-network
36+
37+
volumes:
38+
postgres_data:
39+
rabbitmqdata:
40+
41+
networks:
42+
app-network:
43+
driver: bridge

docker-compose.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
environment:
88
- APP_ENV=production
99
env_file:
10-
- .env.production
10+
- .env.development.docker
1111
depends_on:
1212
postgres:
1313
condition: service_healthy
@@ -17,8 +17,6 @@ services:
1717
- "8090:8090"
1818
networks:
1919
- app-network
20-
volumes:
21-
- ./credentials/key.json:/app/credentials/key.json
2220

2321
postgres:
2422
image: postgres:16
@@ -65,8 +63,6 @@ services:
6563
condition: service_healthy
6664
networks:
6765
- app-network
68-
volumes:
69-
- ./credentials/key.json:/app/credentials/key.json
7066

7167
frontend:
7268
image: approved-frontend:latest
@@ -79,7 +75,7 @@ services:
7975
environment:
8076
APP_ENV: production
8177
env_file:
82-
- .env.frontend.production
78+
- .env.frontend.docker
8379
networks:
8480
- app-network
8581

0 commit comments

Comments
 (0)