Skip to content

Commit

Permalink
Merge pull request #11 from Cr4z1k/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Cr4z1k authored Apr 14, 2024
2 parents 3a7583e + 1eb881f commit 21113f4
Showing 15 changed files with 1,289 additions and 39 deletions.
7 changes: 7 additions & 0 deletions deploy/pg/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM postgres:latest

COPY ./deploy/pg/init-db.sh /docker-entrypoint-initdb.d/

EXPOSE 5432

CMD ["postgres"]
6 changes: 6 additions & 0 deletions deploy/pg/init-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE DATABASE test;
EOSQL
File renamed without changes.
File renamed without changes.
14 changes: 11 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@ version: '3.9'
services:
backend:
container_name: avito-backend
build: ./
build:
context: .
dockerfile: ./deploy/service/Dockerfile
ports:
- '8000:8080'
environment:
@@ -16,11 +18,14 @@ services:
- avito-network

db:
image: postgres:latest
container_name: pg_database
build:
context: .
dockerfile: ./deploy/pg/Dockerfile
restart: always
volumes:
- db-data:/var/lib/postgresql/data
- db-data-test:/var/lib/postgresql/test
expose:
- 5432
environment:
@@ -39,7 +44,7 @@ services:
container_name: integration-tests
build:
context: .
dockerfile: ./integration-test/Dockerfile
dockerfile: ./deploy/tests/Dockerfile
environment:
- RUN_TESTS=${RUN_TESTS}
depends_on:
@@ -51,6 +56,9 @@ services:
volumes:
db-data:
driver: local
db-data-test:
driver: local


networks:
avito-network:
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -142,6 +142,8 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading

0 comments on commit 21113f4

Please sign in to comment.