working database in docker-compose
This commit is contained in:
parent
1f5a5ab95e
commit
795d6567b1
|
@ -1,4 +1,4 @@
|
|||
/connect candymat_db
|
||||
\connect candymat_db
|
||||
|
||||
-- Create schema for candymat_data
|
||||
CREATE SCHEMA candymat_data;
|
||||
|
@ -41,7 +41,7 @@ CREATE TABLE candymat_data.category
|
|||
CREATE TABLE candymat_data.question
|
||||
(
|
||||
id serial primary key,
|
||||
category_id integer REFERENCES candymat_data"category" (id) ON UPDATE CASCADE ON DELETE SET NULL,
|
||||
category_id integer REFERENCES candymat_data."category" (id) ON UPDATE CASCADE ON DELETE SET NULL,
|
||||
text character varying(3000) NOT NULL,
|
||||
description character varying(5000)
|
||||
);
|
||||
|
|
|
@ -4,7 +4,7 @@ services:
|
|||
postgres:
|
||||
image: candymat-postgres:11.5
|
||||
build:
|
||||
dockerfile: ./backend/Dockerfile.postgres
|
||||
dockerfile: ./Dockerfile.postgres
|
||||
context: ./backend/
|
||||
env_file: ./backend/.env-backend
|
||||
ports:
|
||||
|
@ -12,4 +12,6 @@ services:
|
|||
restart: always
|
||||
networks:
|
||||
- backend
|
||||
|
||||
|
||||
networks:
|
||||
backend:
|
|
@ -4,14 +4,18 @@ services:
|
|||
postgres:
|
||||
image: candymat-postgres:11.5
|
||||
build:
|
||||
dockerfile: ./backend/Dockerfile.postgres
|
||||
dockerfile: ./Dockerfile.postgres
|
||||
context: ./backend/
|
||||
env_file: ./backend/.env-backend
|
||||
volumes:
|
||||
- "db-data:/var/lib/postgresql/data"
|
||||
ports:
|
||||
- "5432:5432"
|
||||
restart: always
|
||||
volumes:
|
||||
- "db-data:/var/lib/postgresql/data"
|
||||
networks:
|
||||
- backend
|
||||
|
||||
|
||||
networks:
|
||||
backend:
|
||||
columes:
|
||||
db-data:
|
Loading…
Reference in a new issue