-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add docker-compose - add nginx docker image and nginx conf for frontend - remove .env file from backend folder - instead make settings default values the ones used for local development - replace USER_DATABASE_PATH and MILESTONE_DATABASE_PATH with single DATABASE_PATH folder - add mondey_backend/db folder to use as a default location for databases when running backend locally without docker - add `/api` root_path to API, forward all /api locations in nginx to the backend - note that nginx config is only http for now
- Loading branch information
Showing
13 changed files
with
124 additions
and
23 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 @@ | ||
services: | ||
backend: | ||
image: ghcr.io/ssciwr/mondey_backend:${MONDEY_DOCKER_IMAGE_TAG:-latest} | ||
build: ./mondey_backend | ||
volumes: | ||
- ${STATIC_FILES_PATH:-./static}:/app/static | ||
- ${DATABASE_PATH:-./db}:/app/db | ||
environment: | ||
- SECRET=${SECRET:-} | ||
- STATIC_FILES_PATH=/app/static | ||
- DATABASE_PATH=/app/db | ||
- ENABLE_CORS=${ENABLE_CORS:-false} | ||
- HOST=${HOST:-backend} | ||
- PORT=${PORT:-80} | ||
- RELOAD=${RELOAD:-false} | ||
- LOG_LEVEL=${LOG_LEVEL:-info} | ||
frontend: | ||
image: ghcr.io/ssciwr/mondey_frontend:${MONDEY_DOCKER_IMAGE_TAG:-latest} | ||
build: | ||
context: ./frontend | ||
args: | ||
- MONDEY_API_URL=/api | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
# volumes: | ||
# - ${MONDEY_SSL_CERT:-./cert.pem}:/MONDEY_ssl_cert.pem | ||
# - ${MONDEY_SSL_KEY:-./key.pem}:/MONDEY_ssl_key.pem | ||
# email: | ||
# image: "boky/postfix" | ||
# environment: | ||
# - ALLOW_EMPTY_SENDER_DOMAINS="true" | ||
# networks: | ||
# - mondey-network |
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 +1,2 @@ | ||
VITE_MONDEY_API_URL=http://localhost:8000 | ||
# api location for local development: | ||
VITE_MONDEY_API_URL=http://localhost:8000/api |
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,26 @@ | ||
FROM node:22-slim AS builder | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/ssciwr/mondey | ||
LABEL org.opencontainers.image.description="MONDEY frontend production image" | ||
|
||
ARG MONDEY_API_URL | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install -g pnpm | ||
|
||
RUN pnpm install | ||
|
||
COPY . . | ||
|
||
RUN echo "VITE_MONDEY_API_URL=${MONDEY_API_URL}" > .env | ||
|
||
RUN pnpm run build | ||
|
||
FROM nginx | ||
|
||
COPY --from=builder /app/build /usr/share/nginx/html | ||
|
||
COPY nginx.conf /etc/nginx/conf.d/default.conf |
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 @@ | ||
server { | ||
listen 80; | ||
# listen 443 ssl; | ||
# listen [::]:443 ssl; | ||
http2 on; | ||
server_name localhost; | ||
# ssl_certificate /ssl_cert.pem; | ||
# ssl_certificate_key /ssl_key.pem; | ||
|
||
# Maximum file upload size | ||
client_max_body_size 20M; | ||
|
||
# Improve HTTPS performance with session resumption | ||
ssl_session_cache shared:SSL:10m; | ||
ssl_session_timeout 10m; | ||
|
||
# Enable server-side protection against BEAST attacks | ||
ssl_protocols TLSv1.2; | ||
ssl_prefer_server_ciphers on; | ||
ssl_ciphers "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384"; | ||
|
||
# Aditional Security Headers | ||
# ref: https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security | ||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; | ||
|
||
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options | ||
add_header X-Frame-Options DENY always; | ||
|
||
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options | ||
add_header X-Content-Type-Options nosniff always; | ||
|
||
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection | ||
add_header X-Xss-Protection "1; mode=block" always; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
location /api/ { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
proxy_pass http://backend:80; | ||
} | ||
} |
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 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
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 |
---|---|---|
|
@@ -36,7 +36,6 @@ sqlite> UPDATE user SET is_superuser = 1 WHERE email = '[email protected] | |
|
||
The backend can be configured using environment variables, | ||
which can be set in a `.env` file in the working directory where you start the backend. | ||
Default settings for local development are included in [.env](.env). | ||
|
||
## Tests | ||
|
||
|
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 @@ | ||
This is the default folder where the databases will be created and stored when running the backend locally. |
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