Skip to content

Commit 53333a8

Browse files
committed
Add docker compose for local DEV
Closes: #11
1 parent 66f6377 commit 53333a8

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,23 @@ export $(cat .env | xargs)
7474
bash docker-entrypoint.sh
7575
```
7676

77+
### Docker
78+
79+
To build the project in docker you can use:
80+
81+
```commandline
82+
docker-compose up --build
83+
```
84+
85+
Keep in mind docker-compose.yaml is for local DEV only.
86+
It is NOT secure to use it in production as passwords are
87+
hardcoded there for now (but you always can create a PR to fix it).
88+
89+
#### Notes
90+
91+
- Sending emails are disabled as this feature requires real env vars to be set.
92+
- Redis is not being used in reality, but there is a task to move background tasks to redis.
93+
7794
<p align="right">(<a href="#top">back to top</a>)</p>
7895

7996
## Contributing

docker-compose.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
services:
2+
futuramaapi:
3+
build: .
4+
command: sh docker-entrypoint.sh
5+
volumes:
6+
- .:/app
7+
ports:
8+
- 8080:8080
9+
environment:
10+
- ALLOW_ORIGINS=*
11+
- DATABASE_URL=postgresql://futuramaapi:futuramaapi-psql-password@futuramaapi-postgres:5432/futuramaapi
12+
- TRUSTED_HOST=localhost
13+
- SECRET_KEY=PRODUCTION-SECRET-KEY
14+
- EMAIL_FROM_DEFAULT=default@from.email
15+
- EMAIL_HOST_USER=host-user
16+
- EMAIL_HOST=email-host
17+
- EMAIL_API_KEY=secret-api-key
18+
- REDISCLOUD_URL=redis://redis-admin:futuramaapi-redis-password@futuramaapi-redis:6379
19+
- SEND_EMAILS=false
20+
depends_on:
21+
- futuramaapi-postgres
22+
- futuramaapi-redis
23+
24+
futuramaapi-postgres:
25+
image: postgres:17-alpine
26+
volumes:
27+
- postgres_data:/var/lib/postgresql/data/
28+
expose:
29+
- 5432
30+
environment:
31+
- POSTGRES_USER=futuramaapi
32+
- POSTGRES_PASSWORD=futuramaapi-psql-password
33+
- POSTGRES_DB=futuramaapi
34+
35+
futuramaapi-redis:
36+
image: redis:6.2-alpine
37+
restart: always
38+
ports:
39+
- '6379:6379'
40+
command: redis-server --save 20 1 --loglevel warning --requirepass futuramaapi-redis-password
41+
volumes:
42+
- futuramaapi-redis:/data
43+
44+
volumes:
45+
postgres_data:
46+
futuramaapi-redis:

0 commit comments

Comments
 (0)