Skip to content

Commit 4ae7a58

Browse files
authored
Merge pull request #1 from finmars-platform/PLAT-1823-7
Update docker files
2 parents 5ffc573 + d5633d9 commit 4ae7a58

20 files changed

+43
-587
lines changed

.env.sample

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ AUTHORIZER_URL=
3232
BACKEND_ROLES=
3333
CSRF_COOKIE_DOMAIN=
3434
REDIS_HOST=
35-
RABBITMQ_HOST=
36-
LOCAL=1
35+
RABBITMQ_HOST=

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,5 @@ api_docs
167167
postgres_data/
168168
rabbitmq_data/
169169
redis_data/
170+
171+
*.sql

Dockerfile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111

1212
WORKDIR /var/app
1313

14+
RUN mkdir -p \
15+
/var/app-data/import/configs/ \
16+
/var/app-data/import/files/ \
17+
/var/app-data/media/ \
18+
/var/app/finmars_data \
19+
/var/log/celery \
20+
/var/log/finmars/backend && \
21+
chmod 777 /var/app/finmars_data /var/log/finmars/
22+
1423
COPY requirements.txt .
1524
RUN pip install --upgrade pip && \
1625
pip install --no-cache-dir -r requirements.txt
@@ -22,21 +31,9 @@ COPY poms_app ./poms_app
2231
COPY poms ./poms
2332
COPY manage.py ./
2433

25-
# Create necessary directories and change permissions
26-
RUN mkdir -p \
27-
/var/app-data/import/configs/ \
28-
/var/app-data/import/files/ \
29-
/var/app-data/media/ \
30-
/var/app/finmars_data \
31-
/var/log/celery \
32-
/var/log/finmars/backend && \
33-
chmod 777 /var/app/finmars_data
34-
3534
ENV LC_ALL=C.UTF-8 \
3635
LANG=C.UTF-8
3736

38-
# Make port 8080 available outside container
3937
EXPOSE 8080
4038

41-
# Run the command on container startup
4239
CMD ["gunicorn", "poms_app.wsgi", "--config", "poms_app/gunicorn.py"]

celery-dev.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

docker-compose-stage.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '2'
21
services:
32
db:
43
image: postgres:13-alpine
@@ -11,15 +10,22 @@ services:
1110
tty: true
1211
ports:
1312
- "5434:5432"
13+
volumes:
14+
- ./postgres_data:/var/lib/postgresql/data
15+
1416
rabbitmq:
1517
image: rabbitmq
1618
ports:
1719
- "5672:5672"
1820
stdin_open: true
1921
tty: true
22+
2023
redis:
2124
image: redis
2225
ports:
2326
- "6379:6379"
2427
stdin_open: true
25-
tty: true
28+
tty: true
29+
30+
volumes:
31+
postgres_data:

docker-compose.yml

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
services:
22
web:
3-
build:
4-
context: .
5-
dockerfile: Dockerfile
3+
build: .
64
env_file:
75
- .env
86
volumes:
97
- ./poms:/var/app/poms
108
restart: always
11-
depends_on:
12-
- db
13-
- rabbitmq
14-
- redis
15-
- backend_migration
169
ports:
1710
- "8080:8080"
1811

@@ -21,58 +14,23 @@ services:
2114
env_file:
2215
- .env
2316
environment:
17+
- DJANGO_SETTINGS_MODULE=poms_app.settings # remove after change manage.py location
2418
- INSTANCE_TYPE=worker
25-
depends_on:
26-
- db
27-
- rabbitmq
2819

2920
scheduler:
3021
build: .
3122
env_file:
3223
- .env
3324
environment:
25+
- DJANGO_SETTINGS_MODULE=poms_app.settings # remove after change manage.py location
3426
- INSTANCE_TYPE=beat
35-
depends_on:
36-
- db
37-
- rabbitmq
3827

39-
backend_migration:
28+
migration:
4029
build: .
4130
env_file:
4231
- .env
4332
environment:
4433
- INSTANCE_TYPE=job
45-
depends_on:
46-
- db
47-
command: python manage.py migrate_all_schemes
48-
49-
db:
50-
image: postgres:13-alpine
51-
environment:
52-
POSTGRES_USER: postgres
53-
POSTGRES_PASSWORD: postgres
54-
POSTGRES_DB: finmars_dev
55-
POSTGRESQL_MAX_OPEN_CONNS: 500
56-
stdin_open: true
57-
tty: true
58-
ports:
59-
- "5434:5432"
60-
volumes:
61-
- ./postgres_data:/var/lib/postgresql/data
62-
63-
rabbitmq:
64-
image: rabbitmq
65-
ports:
66-
- "5672:5672"
67-
stdin_open: true
68-
tty: true
69-
70-
redis:
71-
image: redis
72-
ports:
73-
- "6379:6379"
74-
stdin_open: true
75-
tty: true
7634

7735
volumes:
7836
postgres_data:

docker/finmars-job-run.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

docker/finmars-run-old.sh

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)