first commit
This commit is contained in:
13
deployment/Dockerfile
Normal file
13
deployment/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM golang:latest as build
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o ferurl
|
||||
|
||||
FROM alpine:latest
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/ferurl /app/ferurl
|
||||
COPY web/ /app/web/
|
||||
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT [ "/app/ferurl" ]
|
||||
35
deployment/compose.yml
Normal file
35
deployment/compose.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
services:
|
||||
redis:
|
||||
image: redis:8.2-alpine
|
||||
command: redis-server --requirepass ${REDIS_PASSWORD}
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
db:
|
||||
image: postgres:17.5
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_DB: ${DB_NAME}
|
||||
ports:
|
||||
- 5432:5432
|
||||
volumes:
|
||||
- ./postgres-init:/docker-entrypoint-initdb.d
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
command: postgres -c listen_addresses='*' -c log_statement=all
|
||||
|
||||
app:
|
||||
build: .
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- 3000:3000
|
||||
depends_on:
|
||||
- redis
|
||||
- db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- REDIS_HOST=redis
|
||||
- DB_HOST=db
|
||||
volumes:
|
||||
postgres-data:
|
||||
Reference in New Issue
Block a user