Skip to content

Commit

Permalink
last
Browse files Browse the repository at this point in the history
  • Loading branch information
timurIsaevIY committed Sep 29, 2024
2 parents b7f9664 + 1cf3a82 commit 1cae322
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
9 changes: 0 additions & 9 deletions build/docker-compose.yml

This file was deleted.

2 changes: 1 addition & 1 deletion build/main.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.7-alpine AS builder
FROM golang:1.23.1-alpine AS builder
COPY . /github.com/go-park-mail-ru/2024_2_ThereWillBeName
WORKDIR /github.com/go-park-mail-ru/2024_2_ThereWillBeName
RUN go mod download
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
flag.IntVar(&cfg.Port, "port", 8080, "API server port")
flag.StringVar(&cfg.Env, "env", "development", "Environment")
flag.StringVar(&cfg.AllowedOrigin, "allowed-origin", "*", "Allowed origin")
flag.StringVar(&cfg.ConnStr, "connStr", "host=localhost port=5433 user=test_user password=1234567890 dbname=testdb_tripadvisor sslmode=disable", "PostgreSQL connection string")
flag.StringVar(&cfg.ConnStr, "connStr", "host=tripdb port=5432 user=service password=test dbname=trip sslmode=disable", "PostgreSQL connection string")
flag.Parse()

newPlaceRepo := placerepo.NewPLaceRepository()
Expand Down
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3.3"

services:
main:
container_name: main-service
build:
context: .
dockerfile: ./build/main.Dockerfile
ports:
- 8080:8080
tripdb:
container_name: postgres
image: postgres:15
environment:
POSTGRES_DB: "trip"
POSTGRES_USER: "service"
POSTGRES_PASSWORD: "test"
volumes:
- ./migrations:/docker-entrypoint-initdb.d
restart: unless-stopped
ports:
- 5432:5432
7 changes: 7 additions & 0 deletions migrations/01_up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS users
(
id SERIAL PRIMARY KEY, -- Уникальный идентификатор пользователя
login VARCHAR(255) NOT NULL, -- Логин пользователя
password VARCHAR(255) NOT NULL, -- Хэш пароля
created_at TIMESTAMP NOT NULL DEFAULT NOW() -- Дата создания пользователя
);

0 comments on commit 1cae322

Please sign in to comment.