-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: deployment improvements (#372)
* chore: reduce image size * feat: tool-versions * chore: networking * feat: dns servers * chore: remove unnecessary copy's * chore: I hate fixtures * chore: remove unneccessary rm * chore: added back container names
- Loading branch information
Showing
19 changed files
with
84 additions
and
105 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
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
.tool-versions | ||
.env | ||
.venv | ||
.idea | ||
|
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
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,2 @@ | ||
python 3.11.8 | ||
nodejs 18.17.1 |
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 |
---|---|---|
@@ -1,11 +1,20 @@ | ||
FROM python:3.11.4-alpine3.18 | ||
FROM python:3.11.4-alpine3.18 as requirements | ||
|
||
RUN apk update && apk add --no-cache gettext libintl && pip install -U poetry | ||
RUN poetry config virtualenvs.create false | ||
RUN pip install poetry-plugin-export | ||
|
||
WORKDIR /code | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
RUN poetry install --only main | ||
|
||
COPY . ./ | ||
RUN poetry export --without-hashes --format=requirements.txt > requirements.txt | ||
|
||
|
||
FROM python:3.11.4-alpine3.18 | ||
|
||
RUN apk add --no-cache gettext libintl | ||
|
||
WORKDIR /code | ||
|
||
COPY --from=requirements /code/requirements.txt . | ||
|
||
RUN pip install -r requirements.txt --no-cache-dir |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
workers = 4 | ||
bind = "0.0.0.0:8080" | ||
bind = "0.0.0.0:8000" | ||
chdir = "/code/" | ||
module = "ypovoli.wsgi:application" |
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 |
---|---|---|
@@ -1,10 +1,7 @@ | ||
echo "Installing dependencies..." | ||
pip install poetry > /dev/null 2>&1 | ||
poetry install > /dev/null | ||
echo "Migrating database..." | ||
python manage.py migrate > /dev/null | ||
python manage.py migrate > /dev/null 2>&1 | ||
echo "Compiling translations..." | ||
django-admin compilemessages > /dev/null | ||
django-admin compilemessages > /dev/null 2>&1 | ||
echo "Generating Swagger documentation..." | ||
echo "yes" | python manage.py collectstatic > /dev/null | ||
echo "Done" | ||
echo "yes" | python manage.py collectstatic > /dev/null 2>&1 | ||
echo "Setup complete" |
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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ events { | |
|
||
http { | ||
upstream backend { | ||
server backend:8080; | ||
server backend:8000; | ||
} | ||
|
||
upstream frontend { | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ events { | |
|
||
http { | ||
upstream backend { | ||
server backend:8080; | ||
server backend:8000; | ||
} | ||
|
||
upstream frontend { | ||
|
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
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
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
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 |
---|---|---|
|
@@ -5,5 +5,3 @@ WORKDIR /app | |
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
COPY . /app/ |
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
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
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
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
Oops, something went wrong.