compose
version: '3.8'
services:
api:
image: pavel2232/where_to_go:$GITHUB_REF_NAME-$GITHUB_RUN_ID
env_file:
- .env
depends_on:
db:
condition: service_healthy
ports:
- "8000:8000"
container_name: where_to_go_app
volumes:
- ./Where_to_go/:/where_to_go/Where_to_go
db:
image: postgres:12.4-alpine
environment:
POSTGRES_USER: $DB_USER
POSTGRES_PASSWORD: $DB_PASSWORD
POSTGRES_DB: $DB_NAME
restart: always
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pablo -d wheretogo"]
interval: 5s
timeout: 30s
retries: 5
container_name: pg_db
volumes:
Where_to_go:
postgres_data:
FROM python:3.11.3
WORKDIR Where_to_go/
RUN pip install "poetry==1.3.1"
COPY poetry.lock pyproject.toml ./
RUN poetry config virtualenvs.create false \
&& poetry install --without dev --no-root
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY . .
EXPOSE 8000
ENTRYPOINT ["bash","entrypoint.sh" ]
CMD ["gunicorn", "Where_to_go.wsgi", "-w", "4","-b","127.0.0.1:8000"]