forked from cdlib/presign_prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
73 lines (68 loc) · 1.59 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
services:
test-lib:
build:
context: .
target: test
args:
- TEST_COMMAND=poetry run pytest tests/lib
test-server:
build:
context: .
target: test
args:
- TEST_COMMAND=poetry run pytest tests/server
test-client:
build:
context: .
target: test
args:
- TEST_COMMAND=poetry run pytest tests/client
profiles:
- integration
server:
build:
context: .
target: production
command: ["python", "-m", "gunicorn", "-b", "0.0.0.0", "server:app"]
ports:
- "8000:8000"
environment:
- FLASK_ENV=production
- APP_PORT=8000
- KEYS_DIR=keys
- URL_EXPIRATION=3600
- TOKEN_EXPIRATION=3600
- MAX_FILE_NAME_LENGTH=60
# Make sure these are exported before running the docker-compose command.
- AWS_REGION
- S3_BUCKET_NAME
- S3_FOLDER
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
volumes:
- ./keys:/app/keys
depends_on:
- test-lib
- test-server
client:
build:
context: .
target: production
command: >
bash -c "echo 'test upload' > test_file.txt
&& python generate_rsa_keys.py --user test
&& python client.py --file test_file.txt"
environment:
- PRIVATE_KEYS_PATH=keys/test_private.pem
- USER=test
- JWT_EXPIRATION=3600
- SERVER_URL=http://server:8000/api/endpoint
volumes:
- ./keys:/app/keys
depends_on:
- test-client
- server
profiles:
- integration