Skip to content

Commit

Permalink
feat: prod compose
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jan 16, 2024
1 parent b6f069c commit fb05690
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ COPY . .
# Build the application
RUN go build -o server ./cmd/main.go

# Copy config files
COPY ./config ./config

# Adding the grpc_health_probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.1 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
Expand All @@ -36,9 +33,6 @@ COPY --from=base /bin/grpc_health_probe ./
# Copy execute file
COPY --from=base /app/server ./

# Copy config files
COPY --from=base /app/config ./config

# Set ENV to production
ENV GO_ENV production

Expand Down
56 changes: 56 additions & 0 deletions docker-compose-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: "3"

services:
auth:
container_name: johnjud-auth
restart: unless-stopped
build: .
ports:
- 3002:3002
environment:
- APP_PORT=3004
- APP_ENV=development
- APP_SECRET=secret
- DB_URL=postgres://root:root@johnjud-local-db:5432/johnjud_db
- JWT_SECRET=secret
- JWT_EXPIRES_IN=3600
- JWT_REFRESH_TOKEN_TTL=604800
- JWT_ISSUER=issuer
- JWT_RESET_TOKEN_TTL=900
- REDIS_HOST=localhost
- REDIS_PORT=6379
- REDIS_PASSWORD=
- AUTH_CLIENT_URL=http://localhost:3000
- SENDGRID_API_KEY=api_key
- SENDGRID_NAME=johnjud
- SENDGRID_ADDRESS=johnjud@gmail.com
networks:
- johnjud

local-db:
image: postgres:15.1-alpine3.17
container_name: johnjud-local-db
restart: unless-stopped
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: johnjud_db
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- johnjud

cache:
image: redis
restart: unless-stopped
ports:
- "6379:6379"
networks:
- johnjud

volumes:
postgres:
networks:
johnjud:

0 comments on commit fb05690

Please sign in to comment.