Skip to content

Commit

Permalink
Test CI/CD Railway V.1.25
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   Dockerfile
	modified:   oc_lettings_site/settings.py
	modified:   railway.json
  • Loading branch information
Bubhux committed Jan 19, 2025
1 parent 92373c0 commit f1118bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV SENTRY_DSN $SENTRY_DSN
ENV PORT 8080
ENV PORT=${PORT:-8080}

# Ajout du répertoire de l'environnement virtuel au PATH pour accéder à gunicorn sans chemin absolu
ENV PATH="/app/venv/bin:$PATH"
Expand All @@ -55,4 +55,5 @@ RUN /app/venv/bin/gunicorn --version

# Commande par défaut pour exécuter le serveur Django avec Gunicorn
CMD ["sh", "-c", "/app/venv/bin/gunicorn --bind 0.0.0.0:$PORT --workers=4 oc_lettings_site.wsgi:application"]
RUN echo "Port is: $PORT"
RUN echo "Port is: ${PORT:-8080}"
RUN env
2 changes: 2 additions & 0 deletions oc_lettings_site/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
print(f"Running on port: {os.environ.get('PORT')}")
import os
import sentry_sdk
import dj_database_url

Expand Down
2 changes: 1 addition & 1 deletion railway.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dockerfilePath": "Dockerfile"
},
"deploy": {
"startCommand": "gunicorn --workers=4 --bind 0.0.0.0:$PORT oc_lettings_site.wsgi:application",
"startCommand": "gunicorn --workers=4 --bind 0.0.0.0:${PORT:-8080} oc_lettings_site.wsgi:application",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 5
}
Expand Down

0 comments on commit f1118bd

Please sign in to comment.