Commit 7722594f authored by deepdey's avatar deepdey

feat: add server configuration

parent 9ff3a6b1
FROM ubuntu:22.04
MAINTAINER WTL
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y python3.10 python3-pip
RUN mkdir -p /home/nkdassh/pyrestapi
RUN mkdir -p /home/nkdassh/pyrestapi/webomagic_user/
WORKDIR /home/nkdassh/pyrestapi/webomagic_user/
ADD . /home/nkdassh/pyrestapi/webomagic_user/
RUN --mount=type=cache,target=/root/.cache pip3 install -r requirements.txt
CMD ["main.py"]
ENTRYPOINT ["python3"]
......@@ -10,6 +10,7 @@ POSTGRES: dict = {
'user': os.environ.get('POSTGRES_USER', 'postgres'),
'db': os.environ.get('POSTGRES_DB', 'user_db'),
'host': os.environ.get('POSTGRES_HOST', '127.0.0.1'),
# 'password': urllib.parse.quote(os.environ.get('POSTGRES_PASSWORD', 'P@$$w0rdIITKGP')),
'password': urllib.parse.quote(os.environ.get('POSTGRES_PASSWORD', '2580')),
'port': os.environ.get('POSTGRES_PORT', '5432')
}
......
......@@ -13,13 +13,13 @@ INSERT INTO
)
VALUES
(
'deepdey',
'Deep',
'Dey',
'lamartiniere',
'La Martiniere',
'',
'$2b$12$du0B3AlnD5wOYxt.ADYPwuaCFqF7R3XrLHDiNca4FvVtTGPIQVEu2',
'8697448896',
'deep.websofttechs@gmail.com',
'MALE',
'03340406612',
'admin@lamartiniere.co',
'UNDEFINED',
true,
0
);
......@@ -14,22 +14,6 @@ CREATE TABLE
updated_at TIMESTAMP
);
CREATE TABLE
IF NOT EXISTS role (
id BIGSERIAL PRIMARY KEY NOT NULL,
role_type_id BIGINT NOT NULL,
role_name VARCHAR(80) NOT NULL,
project_id BIGINT NOT NULL,
is_deleted BOOLEAN DEFAULT false,
created_at TIMESTAMP NOT NULL DEFAULT now (),
created_by BIGINT NOT NULL,
updated_at TIMESTAMP
updated_by BIGINT,
FOREIGN KEY (role_type_id) REFERENCES role_type(id),
FOREIGN KEY (created_by) REFERENCES webomagic_user (id),
FOREIGN KEY (updated_by) REFERENCES webomagic_user (id)
);
CREATE TABLE
IF NOT EXISTS webomagic_user (
id BIGSERIAL PRIMARY KEY NOT NULL,
......@@ -45,4 +29,20 @@ CREATE TABLE
is_deleted BOOLEAN DEFAULT false,
created_at TIMESTAMP NOT NULL DEFAULT now (),
updated_at TIMESTAMP
);
CREATE TABLE
IF NOT EXISTS role (
id BIGSERIAL PRIMARY KEY NOT NULL,
role_type_id BIGINT NOT NULL,
role_name VARCHAR(80) NOT NULL,
project_id BIGINT NOT NULL,
is_deleted BOOLEAN DEFAULT false,
created_at TIMESTAMP NOT NULL DEFAULT now (),
created_by BIGINT NOT NULL,
updated_at TIMESTAMP,
updated_by BIGINT,
FOREIGN KEY (role_type_id) REFERENCES role_type(id),
FOREIGN KEY (created_by) REFERENCES webomagic_user (id),
FOREIGN KEY (updated_by) REFERENCES webomagic_user (id)
);
\ No newline at end of file
version: '3.8'
services:
webomagic-redis:
container_name: webomagic-redis
image: 'redis'
command: ['redis-server', '--appendonly', 'yes']
ports:
- '6377:6379'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
volumes:
- ./webomagic-redis:/data
restart: always
webomagic-user-backend:
container_name: webomagic-user-backend
image: webomagic-user-backend
ports:
- '5011:5011'
depends_on:
- webomagic-redis
volumes:
- ./logs/webomagic-user-backend:/home/iitkgpssh/docker/logs/
environment:
- SERVER_HOST=0.0.0.0
- SERVER_PORT=5011
- POSTGRES_USER=webomagic_python_db
- POSTGRES_DB=webomagic_user
- POSTGRES_HOST=103.154.184.85
- POSTGRES_PORT=5433
- REDIS_HOST=103.154.184.85
- REDIS_PORT=6377
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment