dev env
This commit is contained in:
5
.build/dev/nginx.Dockerfile
Normal file
5
.build/dev/nginx.Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM nginx
|
||||
|
||||
COPY .build/dev/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
WORKDIR /etc/nginx
|
||||
30
.build/dev/nginx.conf
Normal file
30
.build/dev/nginx.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
server_name _;
|
||||
access_log /dev/stdout;
|
||||
error_log /dev/stdout info;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://backend:8000/api/;
|
||||
}
|
||||
|
||||
location /ws/ {
|
||||
proxy_pass http://backend:8000/ws/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
location / {
|
||||
# In development, proxy to Vite dev server
|
||||
proxy_pass http://frontend:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
5
.build/dev/node.Dockerfile
Normal file
5
.build/dev/node.Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM node:24-bookworm-slim
|
||||
|
||||
WORKDIR /var/www/html/public
|
||||
|
||||
CMD npm run dev -- --host 0.0.0.0
|
||||
7
.build/dev/python.Dockerfile
Normal file
7
.build/dev/python.Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM python:3.11.4-slim-buster
|
||||
|
||||
WORKDIR /var/www/html/
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
56
compose.yml
Normal file
56
compose.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
services:
|
||||
python:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .build/dev/python.Dockerfile
|
||||
hostname: backend
|
||||
restart: always
|
||||
command: uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
node:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .build/dev/node.Dockerfile
|
||||
hostname: frontend
|
||||
restart: always
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
nginx:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .build/dev/nginx.Dockerfile
|
||||
hostname: nginx
|
||||
restart: always
|
||||
ports:
|
||||
- "8000:80"
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
depends_on:
|
||||
- python
|
||||
- node
|
||||
|
||||
postgres:
|
||||
image: postgis/postgis:15-3.3
|
||||
hostname: database
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: mapmaker
|
||||
POSTGRES_PASSWORD: mapmaker
|
||||
POSTGRES_DB: mapmaker
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user