-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Option pour lancer le projet avec Docker (#4574)
Co-authored-by: Stéphane Maniaci <[email protected]>
- Loading branch information
Showing
14 changed files
with
289 additions
and
139 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,34 @@ | ||
# Include any files or directories that you don't want to be copied to your | ||
# container here (e.g., local build artifacts, temporary files, etc.). | ||
# | ||
# For more help, visit the .dockerignore file reference guide at | ||
# https://docs.docker.com/go/build-context-dockerignore/ | ||
|
||
**/.DS_Store | ||
**/__pycache__ | ||
**/.venv | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose.y*ml | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
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,48 @@ | ||
ALLOWED_HOSTS=localhost | ||
SECRET=my local secret | ||
DEBUG=True | ||
DEBUG_FRONT=True | ||
DB_USER=postgres | ||
DB_PASSWORD=password | ||
DB_HOST=db | ||
DB_PORT=3306 | ||
DB_NAME=ma-cantine | ||
HOSTNAME=localhost:8000 | ||
STATICFILES_STORAGE=django.contrib.staticfiles.storage.StaticFilesStorage | ||
DEFAULT_FILE_STORAGE=django.core.files.storage.FileSystemStorage | ||
EMAIL_BACKEND=anymail.backends.sendinblue.EmailBackend | ||
[email protected] | ||
[email protected] | ||
SENDINBLUE_API_KEY= | ||
NEWSLETTER_SENDINBLUE_LIST_ID= | ||
MATOMO_ID= | ||
CELLAR_HOST= | ||
CELLAR_KEY= | ||
CELLAR_SECRET= | ||
CELLAR_BUCKET_NAME= | ||
DATA_WARE_HOUSE_USER= | ||
DATA_WARE_HOUSE_PASSWORD= | ||
DATA_WARE_HOUSE_HOST= | ||
DATA_WARE_HOUSE_PORT= | ||
DATA_WARE_HOUSE_DB= | ||
DEBUG_PERFORMANCE=True | ||
ENVIRONMENT=dev | ||
REDIS_URL=redis://localhost:6379/0 | ||
REDIS_PREPEND_KEY=LOCAL | ||
OVERRIDE_TEST_SEED= | ||
SIRET_API_KEY= | ||
SIRET_API_SECRET= | ||
MONCOMPTEPRO_CLIENT_ID= | ||
MONCOMPTEPRO_SECRET= | ||
MONCOMPTEPRO_CONFIG= | ||
MAX_DAYS_HISTORICAL_RECORDS= | ||
CSV_PURCHASE_CHUNK_LINES= | ||
ENABLE_XP_RESERVATION=True | ||
ENABLE_XP_VEGE=True | ||
ENABLE_TELEDECLARATION=False | ||
TELEDECLARATION_CORRECTION_CAMPAIGN=False | ||
TELEDECLARATION_END_DATE=2024-05-01 | ||
ENABLE_DASHBOARD=True | ||
PUBLISH_BY_DEFAULT=True | ||
ENABLE_VUE3=True | ||
ENABLE_WASTE_MEASUREMENTS=True |
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 @@ | ||
http://localhost:5173 |
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,12 @@ | ||
FROM ma-cantine-server | ||
|
||
WORKDIR /app/2024-frontend | ||
|
||
USER root | ||
|
||
# NB: this wont reinstall on build, must rebuild server image first | ||
RUN npm install | ||
|
||
EXPOSE 5173 | ||
|
||
CMD [ "npm", "run", "dev" ] |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -46,4 +46,7 @@ export default defineConfig({ | |
}, | ||
], | ||
}, | ||
server: { | ||
host: "0.0.0.0", | ||
}, | ||
}) |
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,61 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Comments are provided throughout this file to help you get started. | ||
# If you need more help, visit the Dockerfile reference guide at | ||
# https://docs.docker.com/go/dockerfile-reference/ | ||
|
||
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7 | ||
|
||
ARG PYTHON_VERSION=3.11 | ||
# slim is based on Debian | ||
FROM python:${PYTHON_VERSION}-slim as base | ||
|
||
# Prevents Python from writing pyc files. | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
# Keeps Python from buffering stdout and stderr to avoid situations where | ||
# the application crashes without emitting any logs due to buffering. | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
WORKDIR /app | ||
|
||
# Create a non-privileged user that the app will run under. | ||
# See https://docs.docker.com/go/dockerfile-user-best-practices/ | ||
ARG UID=10001 | ||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/nonexistent" \ | ||
--shell "/sbin/nologin" \ | ||
--no-create-home \ | ||
--uid "${UID}" \ | ||
appuser | ||
|
||
# in order to download the magic auth dependency, which comes from a github repo | ||
# we need to install git | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y git libpq-dev gcc npm | ||
|
||
# i had a problem accessing github.com. When I followed https://docs.docker.com/desktop/get-started/#credentials-management-for-linux-users | ||
# and restarted the problem was resolved | ||
|
||
# Download dependencies as a separate step to take advantage of Docker's caching. | ||
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds. | ||
# Leverage a bind mount to requirements.txt to avoid having to copy them into | ||
# into this layer. | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
--mount=type=bind,source=requirements.txt,target=requirements.txt \ | ||
python -m pip install -r requirements.txt | ||
|
||
# Switch to the non-privileged user to run the application. | ||
USER appuser | ||
|
||
# Copy the source code into the container. | ||
COPY . . | ||
|
||
# Expose the port that the application listens on. | ||
EXPOSE 8000 | ||
|
||
# Run the application. | ||
CMD [ "python", "manage.py", "runserver", "0.0.0.0:8000" ] |
Oops, something went wrong.