Skip to content
Snippets Groups Projects
Commit c5e6675f authored by Santiago Ortiz [EPAM]'s avatar Santiago Ortiz [EPAM] Committed by Rostislav Dublin (EPAM)
Browse files

Resolve "F1: Set up Docker Compose with main service and dependencies"...

Resolve "F1: Set up Docker Compose with main service and dependencies" (!5)
parent 08372d42
Branches
Tags
1 merge request!5Resolve "F1: Set up Docker Compose with main service and dependencies"
......@@ -15,6 +15,7 @@ WORKDIR /app
# Copy project dependencies
COPY pyproject.toml poetry.lock ./
# Install production dependencies only and remove poetry cache directory
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR
......@@ -29,7 +30,10 @@ ENV VIRTUAL_ENV=/app/.venv \
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
# Copy project code
COPY app ./app
COPY app/ /app/
# Set work directory
WORKDIR /app
# Run service
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
......@@ -90,10 +90,15 @@ We are using a distroless image as the default production docker image for an im
**WARNING** Docker-compose it is meant to be used for quick development/testing, not for production.
```shell
# If you just want to run a container
docker-compose up
# If you want to run a container
# and see your changes in real time
docker-compose watch
# Simple test
curl localhost:8080/
curl localhost/
```
#### Run with Dockerfile [MacOS / Linux]
......
services:
api:
image: community.opengroup.org:5555/osdu/platform/system/project-and-workflow
build:
context: .
dockerfile: Dockerfile
container_name: pws
environment:
- WATCHFILES_FORCE_POLLING=true
restart: on-failure
ports:
- "80:80"
develop:
watch:
- action: sync
path: ./app/
target: /app/
ignore:
- .venv/
command: ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80", "--reload"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment