♻️ Add backend and frontend to docker-compose
This commit is contained in:
7
backend/.dockerignore
Normal file
7
backend/.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
docker
|
||||||
|
**/__pycache__
|
||||||
|
poetry.lock
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
config
|
||||||
|
.venv
|
26
backend/Dockerfile
Normal file
26
backend/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
FROM python:3.11-slim as builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
RUN apt update && apt install -y proj-bin
|
||||||
|
|
||||||
|
RUN pip install --upgrade poetry && \
|
||||||
|
poetry config virtualenvs.create false && \
|
||||||
|
poetry install --only=main && \
|
||||||
|
poetry export -f requirements.txt >> requirements.txt
|
||||||
|
|
||||||
|
FROM python:3.11-slim as runtime
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
COPY --from=builder /app/requirements.txt /app
|
||||||
|
|
||||||
|
RUN apt update && apt install -y postgresql libpq5
|
||||||
|
RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV CONFIG_PATH=./config.sample.yaml
|
||||||
|
ENV API_KEY=MwP7lbljnXIYAnmmmPRzasHsIknaiKqD
|
||||||
|
|
||||||
|
CMD ["python", "./main.py"]
|
@@ -15,8 +15,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:5432:5432"
|
- "127.0.0.1:5432:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/database/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
|
- ./backend/docker/database/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
|
||||||
- ./docker/database/data:/var/lib/postgresql/data
|
- ./backend/docker/database/data:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
|
||||||
jaeger-agent:
|
jaeger-agent:
|
||||||
image: jaegertracing/jaeger-agent:latest
|
image: jaegertracing/jaeger-agent:latest
|
||||||
@@ -45,10 +46,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:4317:4317"
|
- "127.0.0.1:4317:4317"
|
||||||
- "127.0.0.1:4318:4318"
|
- "127.0.0.1:4318:4318"
|
||||||
# - "127.0.0.1:9411:9411"
|
|
||||||
# - "127.0.0.1:14250:14250"
|
|
||||||
# - "127.0.0.1:14268:14268"
|
|
||||||
# - "127.0.0.1:14269:14269"
|
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
- cassandra-schema
|
- cassandra-schema
|
||||||
@@ -68,7 +65,16 @@ services:
|
|||||||
- "--cassandra.servers=cassandra"
|
- "--cassandra.servers=cassandra"
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:16686:16686"
|
- "127.0.0.1:16686:16686"
|
||||||
# - "127.0.0.1:16687:16687"
|
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
- cassandra-schema
|
- cassandra-schema
|
||||||
|
|
||||||
|
carrramba-encore-rate-api:
|
||||||
|
build: ./backend/
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:8080:8080"
|
||||||
|
|
||||||
|
carrramba-encore-rate-frontend:
|
||||||
|
build: ./frontend/
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:8081"
|
4
frontend/Dockerfile
Normal file
4
frontend/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# pull the latest official nginx image
|
||||||
|
FROM nginx:mainline-alpine-slim
|
||||||
|
|
||||||
|
COPY dist /usr/share/nginx/html
|
Reference in New Issue
Block a user