-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.yaml
More file actions
62 lines (51 loc) · 2.08 KB
/
compose.yaml
File metadata and controls
62 lines (51 loc) · 2.08 KB
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
# Notes:
# Port allocation for the CryptoSharia project family:
# 5173 = CryptoSharia API
# 5174 = CryptoSharia Admin
# 5175 = CryptoSharia Profile
# 5176 = CryptoSharia News
services:
cryptosharia-admin:
image: node:24-alpine
volumes:
- .:/app # Bind mount: expose the host project folder into /app (live, real-time view of host files)
- /app/node_modules # Anonymous Docker-managed volume mounted at /app/node_modules (overrides the bind mount at that subpath)
env_file:
- .env # Load variables from .env file.
# Explicitly set environment variables.
# Note: Variables defined here will OVERRIDE those with the same name in the .env file loaded above.
environment:
- NODE_ENV=development # Explicitly tells Node and libraries that we are in development mode
ports:
# Maps ports from the host (actual computer) to ports inside the container
- '5174:5174' # [Host Port 5174] : [Container Port 5174]
# Join the shared external network to communicate with other services.
# Note: When communicating between containers on this network, use the
# service name as the hostname instead of 'localhost'.
# Example: To reach the API, use 'http://cryptosharia-api:5173'
networks:
- cryptosharia-net
# Default directory for running the command (like `cd /app`)
working_dir: /app
# `sh -c` Starts a shell to understand the "&&" logic
# `npm install` Install node dependencies and store it inside /app/node_modules Docker-managed volume
# `npm run dev -- --host 0.0.0.0 --port 5174` Starts the SvelteKit dev server and makes it visible outside the container
command: sh -c "npm install && npm run dev -- --host 0.0.0.0 --port 5174"
db:
image: postgres:15-alpine
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: cryptosharia_admin
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- cryptosharia-net
networks:
cryptosharia-net:
external: true
name: cryptosharia-net
volumes:
postgres_data: