docker project

This commit is contained in:
meninjar dev
2024-09-18 06:48:22 +00:00
parent 0b282c0e07
commit 8dac62584d
2 changed files with 46 additions and 0 deletions

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod tidy
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a installsuffix cgo -o main .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
# COPY --from=builder /app/main .
COPY --from=builder /app/.env .
EXPOSE 80
CMD ["./main"]

25
docker-compose.yml Normal file
View File

@@ -0,0 +1,25 @@
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: api-rssa
restart: always
ports:
- 6000:80
volumes:
- .:/app
environment:
# DATABASE SIMRS V3.0
- DB_HOST=localhost
- DB_USERNAME=sa
- DB_PASSWORD=password
- DB_NAME=postgres
- DB_PORT=5432
# DATABASE SATU DATA
- SATUDATA_HOST=10.10.123.165
- SATUDATA_USERNAME=stim
- SATUDATA_PASSWORD=stim*RS54
- SATUDATA_NAME=satu_db
- SATUDATA_PORT=5000