-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Структура папки infra * dev compose work postgresql work * prod * Added prod and stage without specifying the image path. Workflow integration needed --------- Co-authored-by: Евгений Каликов <eskalikov@yandex.com>
- Loading branch information
Showing
5 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: '3.8' | ||
name: ahf_dev | ||
|
||
services: | ||
db: | ||
container_name: db | ||
image: postgres:13.0-alpine | ||
restart: always | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
env_file: | ||
- ../../.env | ||
ports: | ||
- 5432:5432 | ||
|
||
volumes: | ||
postgres_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.11-slim-bullseye AS builder | ||
|
||
WORKDIR /app | ||
COPY poetry.lock pyproject.toml ./ | ||
|
||
RUN python -m pip install --no-cache-dir poetry==1.6.1 \ | ||
&& poetry config virtualenvs.in-project true \ | ||
&& poetry install --without dev --with test | ||
|
||
FROM python:3.11-slim-bullseye | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
COPY --from=builder /app /app | ||
COPY adaptive_hockey_federation/ ./ | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["/app/.venv/bin/gunicorn", "adaptive_hockey_federation.wsgi:application", "--bind", "0:8000" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: '3.8' | ||
name: ahf_prod | ||
|
||
services: | ||
db: | ||
container_name: db | ||
image: postgres:13.0-alpine | ||
restart: always | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
env_file: | ||
- ./.env | ||
|
||
site: | ||
image: imageName | ||
restart: always | ||
volumes: | ||
- static_value:/app/static/ | ||
- media_value:/app/media/ | ||
env_file: | ||
- ./.env | ||
depends_on: | ||
- db | ||
|
||
nginx: | ||
image: nginx:1.21.3-alpine | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ../../nginx/default.conf:/etc/nginx/conf.d/default.conf | ||
- static_value:/var/html/static/ | ||
- media_value:/var/html/media/ | ||
depends_on: | ||
- site | ||
|
||
volumes: | ||
static_value: | ||
media_value: | ||
postgres_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.11-slim-bullseye AS builder | ||
|
||
WORKDIR /app | ||
COPY poetry.lock pyproject.toml ./ | ||
|
||
RUN python -m pip install --no-cache-dir poetry==1.6.1 \ | ||
&& poetry config virtualenvs.in-project true \ | ||
&& poetry install --without dev --with test | ||
|
||
FROM python:3.11-slim-bullseye | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
COPY --from=builder /app /app | ||
COPY adaptive_hockey_federation/ ./ | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["/app/.venv/bin/gunicorn", "adaptive_hockey_federation.wsgi:application", "--bind", "0:8000" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: '3.8' | ||
name: ahf_stage | ||
|
||
services: | ||
db: | ||
container_name: db | ||
image: postgres:13.0-alpine | ||
restart: always | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
env_file: | ||
- ./.env | ||
|
||
site: | ||
image: imageName | ||
restart: always | ||
volumes: | ||
- static_value:/app/static/ | ||
- media_value:/app/media/ | ||
env_file: | ||
- ./.env | ||
depends_on: | ||
- db | ||
|
||
nginx: | ||
image: nginx:1.21.3-alpine | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ../../nginx/default.conf:/etc/nginx/conf.d/default.conf | ||
- static_value:/var/html/static/ | ||
- media_value:/var/html/media/ | ||
depends_on: | ||
- site | ||
|
||
volumes: | ||
static_value: | ||
media_value: | ||
postgres_data: |