-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
289 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DB_PASSWORD=eepha[l3eaph8Xo | ||
JWT_TOKEN_SALT=xamah6Ael!iat0n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ | |
|
||
# Go workspace file | ||
go.work | ||
.env | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM golang:1.21.4-alpine as builder | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
RUN go mod download && go mod verify | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o /usr/local/bin/app cmd/social-network/main.go --config=local_config.yaml | ||
|
||
FROM alpine:3.18 | ||
|
||
COPY --from=builder /usr/local/bin/app /app | ||
|
||
CMD ["/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
logger: | ||
level: "debug" | ||
encoding: "console" | ||
path: "stdout" | ||
|
||
server: | ||
enable: true | ||
endpoint: "localhost" | ||
|
||
storage: | ||
host: "localhost" | ||
port: 5432 | ||
database: "social-network-local" | ||
username: "social-network-local-admin" | ||
ssl_mode: "disable" | ||
connection_attempts: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: "3.9" | ||
|
||
services: | ||
backend: | ||
container_name: "app" | ||
build: | ||
context: . | ||
restart: always | ||
ports: | ||
- "8000:8000" | ||
env_file: | ||
- .env | ||
environment: | ||
- DB_PASSWORD=${DB_PASSWORD} | ||
- PORT=8000 | ||
- JWT_TOKEN_SALT=${JWT_TOKEN_SALT} | ||
depends_on: | ||
- db | ||
volumes: | ||
- .:/app | ||
db: | ||
image: postgres:15-alpine | ||
container_name: "db" | ||
networks: | ||
new: | ||
aliases: | ||
- database | ||
env_file: | ||
- .env.example | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
environment: | ||
- POSTGRES_DB=social-network-local | ||
- POSTGRES_NAME=social-network-local | ||
- POSTGRES_USER=social-network-local-admin | ||
- POSTGRES_PASSWORD=${DB_PASSWORD} | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: [ "CMD-SHELL", "pg_isready -d qtr_portal -U qtr_portal" ] | ||
interval: 5s | ||
retries: 5 | ||
restart: always | ||
|
||
volumes: | ||
postgres_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.