Skip to content

Commit 5d140d4

Browse files
committed
WR-38: Changed docker config
1 parent 010e5e6 commit 5d140d4

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/.idea/
22
/*.iml
33

4+
/data/
45
/.coverage_html/
5-
/.coverage
6+
/.coverage
7+
/.env

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM python:3.8
2-
MAINTAINER phpusr
32

43
ENV PYTHONBUFFERED 1
54
ENV PORT 8000
@@ -8,13 +7,12 @@ ENV DEBUG False
87
WORKDIR /app/
98

109
# Install dependencies
11-
COPY Pipfile Pipfile.lock ./
10+
COPY Pipfile.lock ./
1211
RUN pip install --upgrade pipenv \
13-
&& pipenv lock --requirements > requirements.txt \
12+
&& pipenv requirements > requirements.txt \
1413
&& pip install -r requirements.txt \
15-
&& pipenv --rm \
1614
&& pip uninstall -y pipenv \
17-
&& rm Pipfile Pipfile.lock requirements.txt
15+
&& rm Pipfile.lock requirements.txt
1816

1917
# Add user
2018
RUN useradd user

backend/app/services/backup_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
with open(enc_service_account_file_path) as enc_file:
2121
gdrive_account_data = signing.loads(enc_file.read())
2222

23-
service_account_file_path = os.path.join(settings.BASE_DIR, 'gdrive_account.json')
23+
service_account_file_path = os.path.join('/tmp', 'gdrive_account.json')
2424
with open(service_account_file_path, 'w') as service_account_file:
2525
json.dump(gdrive_account_data, service_account_file)
2626

docker-compose.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ services:
77
image: phpusr/wildrace
88
restart: unless-stopped
99
ports:
10-
- 8010:8000
10+
- ${PORT:-8010}:8000
1111
environment:
1212
- DEBUG=False
1313
- APP_LOG_LEVEL=DEBUG
14-
- PORT=8000
15-
- DATABASE_URL=postgres://postgres:mysuperpassword@db:5432/app
14+
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/app
1615
- REDIS_URL=redis://redis:6379
16+
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY}
17+
- GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID}
18+
- SENTRY_BACKEND_DSN=${SENTRY_BACKEND_DSN}
19+
volumes:
20+
- ./data/db:/app/data
1721
depends_on:
1822
- db
1923
- redis
@@ -24,8 +28,10 @@ services:
2428
restart: unless-stopped
2529
environment:
2630
- POSTGRES_DB=app
27-
- POSTGRES_USER=postgres
28-
- POSTGRES_PASSWORD=mysuperpassword
31+
- POSTGRES_USER=${POSTGRES_USER}
32+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
33+
volumes:
34+
- ./data/pgdata:/var/lib/postgresql/data
2935

3036
redis:
3137
container_name: wildrace-redis

0 commit comments

Comments
 (0)