-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
94 lines (86 loc) · 4.12 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: '3.9'
### Services ###
services:
### Backend Django ###
backend:
build: ./backend # Build in the context of this directory (meaning: use Dockerfile, .dockerignore etc.)
image: samfundet-backend
volumes:
- ./backend:/app # Mount backend folder to docker image
- /app/.venv/ # Ignore local virtual environment
env_file:
- ./backend/.docker.env # Environment for backend docker
environment:
- IS_DOCKER=yes
ports:
- '8000:8000' # Quotes are required. django
- '5678:5678' # Quotes are required. debugpy
### Frontend React ###
# Mount sync on OSX Docker VM is really slow on some systems. Perhaps run on host machine instead.
frontend:
build:
context: ./frontend
image: samfundet-frontend
volumes:
# Share project code between host machine and container to enable reload on changes.
# Excellent solution when component needs files/folders from outside context.
- ./biome.jsonc:/biome.jsonc
- ./frontend/src:/app/src
- ./frontend/biome.jsonc:/app/biome.jsonc
- ./frontend/package.json:/app/package.json
- ./frontend/index.html:/app/index.html
env_file:
- ./frontend/.env.docker # Environment for frontend docker
environment:
- IS_DOCKER=yes
- CHOKIDAR_USEPOLLING=true # Might not be needed. Used for hot reload.
ports:
- '3000:3000'
command: yarn start:docker --host 0.0.0.0 --port 3000
# TODO: Fix, ffs dont just ignore it next time it breaks
# cypress:
# depends_on:
# - frontend
# - backend
# build:
# context: ./frontend
# dockerfile: Dockerfile.cypress
# # platform: linux/arm64/v8
# env_file:
# - ./frontend/.env.docker # Environment for frontend docker
# environment:
# - IS_DOCKER=YES
# - CYPRESS_baseUrl=http://frontend:3000
# volumes:
# - ./frontend/cypress:/frontend/cypress
# command: 'yarn run cypress:run'
## Storybook React ###
storybook:
image: samfundet-frontend
volumes:
- ./frontend/src:/app/src # Share project code between host machine and container to enable reload on changes.
env_file:
- ./frontend/.env.docker # Environment for frontend docker
environment:
- IS_DOCKER=yes
- CHOKIDAR_USEPOLLING=true # Might not be needed. Used for hot reload.
ports:
- '6006:6006'
command: yarn run storybook
### Welcome Splash ###
welcome:
image: alpine:latest # Minimal image (~ 5MB)
command: |
/bin/sh -c 'sleep 5 && printf "
-------------------------------------------------------------------------------
\e[31m███████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗███╗ ██╗██████╗ ███████╗████████╗
\e[31m██╔════╝██╔══██╗████╗ ████║██╔════╝██║ ██║████╗ ██║██╔══██╗██╔════╝╚══██╔══╝
\e[31m███████╗███████║██╔████╔██║█████╗ ██║ ██║██╔██╗ ██║██║ ██║█████╗ ██║
\e[31m╚════██║██╔══██║██║╚██╔╝██║██╔══╝ ██║ ██║██║╚██╗██║██║ ██║██╔══╝ ██║
\e[31m███████║██║ ██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║██████╔╝███████╗ ██║
\e[31m╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═════╝ ╚══════╝ ╚═╝
\e[34mBackend: http://localhost:8000
\e[34mFrontend: http://localhost:3000
\e[34mStorybook: http://localhost:6006
-------------------------------------------------------------------------------
"'