-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the docker compose into dev and prod, fixed more issues with th…
…e deployment and more frontend improvements Frontend: More cosmetic fixes and improvements - markdown looks better now
- Loading branch information
1 parent
6b8d4ca
commit 8949c3c
Showing
13 changed files
with
479 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
services: | ||
frontend: | ||
build: | ||
context: ./frontend | ||
dockerfile: Dockerfile.dev | ||
ports: | ||
- "${FRONTEND_PORT}:${FRONTEND_PORT_DOCKER}" | ||
depends_on: | ||
backend: | ||
condition: service_healthy | ||
workflow: | ||
condition: service_healthy | ||
volume-init: | ||
condition: service_completed_successfully | ||
volumes: | ||
- ./frontend:/app:delegated | ||
- /app/node_modules | ||
- /app/dist | ||
- ./.env:/app/.env:ro | ||
environment: | ||
NODE_ENV: ${NODE_ENV:-development} | ||
CHOKIDAR_USEPOLLING: "true" | ||
WATCHPACK_POLLING: "true" | ||
|
||
backend: | ||
build: | ||
context: ./backend | ||
dockerfile: Dockerfile.dev | ||
ports: | ||
- "${BACKEND_PORT}:${BACKEND_PORT_DOCKER}" | ||
depends_on: | ||
mongo: | ||
condition: service_started | ||
volume-init: | ||
condition: service_completed_successfully | ||
volumes: | ||
- ./backend:/app | ||
- /app/node_modules | ||
- /app/dist | ||
- ./.env:/app/.env | ||
- logs:/app/logs | ||
- shared-uploads:/app/shared-uploads | ||
environment: | ||
NODE_ENV: ${NODE_ENV:-development} | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:${BACKEND_PORT_DOCKER}/api/health"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 5 | ||
start_period: 10s | ||
|
||
workflow: | ||
build: | ||
context: ./workflow | ||
env_file: | ||
- .env | ||
ports: | ||
- "${WORKFLOW_PORT}:${WORKFLOW_PORT_DOCKER}" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- logs:/app/logs | ||
- shared-uploads:/app/shared-uploads:ro | ||
depends_on: | ||
volume-init: | ||
condition: service_completed_successfully | ||
python_image: | ||
condition: service_completed_successfully | ||
bash_image: | ||
condition: service_completed_successfully | ||
environment: | ||
- PYTHONPATH=/app | ||
- HOST=host.docker.internal | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:${WORKFLOW_PORT_DOCKER}/health"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 5 | ||
start_period: 5s | ||
|
||
volume-init: | ||
image: busybox | ||
attach: false | ||
volumes: | ||
- ${COMPOSE_PROJECT_DIR}/logs:/logs | ||
- ${COMPOSE_PROJECT_DIR}/shared-uploads:/shared-uploads | ||
command: | | ||
sh -c " | ||
echo 'Starting volume initialization' && | ||
ls -la / && | ||
echo 'Creating directories' && | ||
mkdir -p /logs /shared-uploads && | ||
echo 'Setting permissions' && | ||
chmod -R 755 /logs && | ||
chown -R 1000:1000 /logs && | ||
chmod -R 755 /shared-uploads && | ||
chown -R 1000:1000 /shared-uploads && | ||
echo 'Finished volume initialization' && | ||
ls -la /logs /shared-uploads | ||
" | ||
mongo: | ||
image: mongo:latest | ||
ports: | ||
- "26017:27017" | ||
volumes: | ||
- mongo_data:/data/db | ||
attach: false | ||
|
||
python_image: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.python | ||
image: mypython:latest | ||
command: ["bash"] | ||
|
||
bash_image: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.bash | ||
image: mybash:latest | ||
command: ["bash"] | ||
|
||
volumes: | ||
logs: | ||
driver: local | ||
driver_opts: | ||
type: none | ||
o: bind | ||
device: ${COMPOSE_PROJECT_DIR}/logs | ||
shared-uploads: | ||
driver: local | ||
driver_opts: | ||
type: none | ||
o: bind | ||
device: ${COMPOSE_PROJECT_DIR}/shared-uploads | ||
mongo_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
services: | ||
frontend: | ||
build: | ||
context: ./frontend | ||
dockerfile: Dockerfile | ||
ports: | ||
- "${FRONTEND_PORT}:${FRONTEND_PORT_DOCKER}" | ||
depends_on: | ||
backend: | ||
condition: service_healthy | ||
workflow: | ||
condition: service_healthy | ||
volume-init: | ||
condition: service_completed_successfully | ||
volumes: | ||
- ./.env:/app/.env:ro | ||
environment: | ||
NODE_ENV: ${NODE_ENV:-production} | ||
CI: "true" | ||
|
||
backend: | ||
build: | ||
context: ./backend | ||
dockerfile: Dockerfile | ||
ports: | ||
- "${BACKEND_PORT}:${BACKEND_PORT_DOCKER}" | ||
depends_on: | ||
mongo: | ||
condition: service_started | ||
volume-init: | ||
condition: service_completed_successfully | ||
volumes: | ||
- ./.env:/app/.env | ||
- logs:/app/logs | ||
- shared-uploads:/app/shared-uploads | ||
environment: | ||
NODE_ENV: ${NODE_ENV:-production} | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:${BACKEND_PORT_DOCKER}/api/health"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 5 | ||
start_period: 10s | ||
|
||
workflow: | ||
build: | ||
context: ./workflow | ||
env_file: | ||
- .env | ||
ports: | ||
- "${WORKFLOW_PORT}:${WORKFLOW_PORT_DOCKER}" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- logs:/app/logs | ||
- shared-uploads:/app/shared-uploads:ro | ||
depends_on: | ||
volume-init: | ||
condition: service_completed_successfully | ||
python_image: | ||
condition: service_completed_successfully | ||
bash_image: | ||
condition: service_completed_successfully | ||
environment: | ||
- PYTHONPATH=/app | ||
- HOST=host.docker.internal | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:${WORKFLOW_PORT_DOCKER}/health"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 5 | ||
start_period: 5s | ||
|
||
volume-init: | ||
image: busybox | ||
attach: false | ||
volumes: | ||
- ${COMPOSE_PROJECT_DIR}/logs:/logs | ||
- ${COMPOSE_PROJECT_DIR}/shared-uploads:/shared-uploads | ||
command: | | ||
sh -c " | ||
echo 'Starting volume initialization' && | ||
ls -la / && | ||
echo 'Creating directories' && | ||
mkdir -p /logs /shared-uploads && | ||
echo 'Setting permissions' && | ||
chmod -R 755 /logs && | ||
chown -R 1000:1000 /logs && | ||
chmod -R 755 /shared-uploads && | ||
chown -R 1000:1000 /shared-uploads && | ||
echo 'Finished volume initialization' && | ||
ls -la /logs /shared-uploads | ||
" | ||
mongo: | ||
image: mongo:latest | ||
ports: | ||
- "26017:27017" | ||
volumes: | ||
- mongo_data:/data/db | ||
attach: false | ||
|
||
python_image: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.python | ||
image: mypython:latest | ||
command: ["bash"] | ||
|
||
bash_image: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.bash | ||
image: mybash:latest | ||
command: ["bash"] | ||
|
||
volumes: | ||
logs: | ||
driver: local | ||
driver_opts: | ||
type: none | ||
o: bind | ||
device: ${COMPOSE_PROJECT_DIR}/logs | ||
shared-uploads: | ||
driver: local | ||
driver_opts: | ||
type: none | ||
o: bind | ||
device: ${COMPOSE_PROJECT_DIR}/shared-uploads | ||
mongo_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.