-
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.
Merge pull request #5 from Randers-Kommune-Digitalisering/develop
Develop
- Loading branch information
Showing
59 changed files
with
2,445 additions
and
12,329 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,3 @@ | ||
flask/__pycache__/ | ||
flask/src/__pycache__/ | ||
vue/node_modules/ |
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 |
---|---|---|
|
@@ -72,4 +72,7 @@ coverage | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
.env* | ||
.env* | ||
|
||
# virtualenv | ||
.venv |
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,30 +1,44 @@ | ||
FROM node:14-alpine AS frontend | ||
FROM node:23-alpine AS vue-build | ||
|
||
WORKDIR /app | ||
|
||
COPY vue/package*.json ./vue/ | ||
RUN cd vue && npm install | ||
## Build and copy the vue app | ||
COPY vue . | ||
RUN npm install && npm run build | ||
|
||
COPY vue/ ./vue/ | ||
RUN cd vue && npm run build | ||
FROM python:3.12-alpine | ||
|
||
RUN cp -r vue/dist dist | ||
# Set dir and user | ||
ENV GROUP_NAME=app | ||
ENV HOME=/app | ||
ENV GROUP_ID=11000 | ||
ENV USER_ID=11001 | ||
ENV PORT=8080 | ||
|
||
RUN rm -rf vue | ||
|
||
FROM python:3.10-alpine AS backend | ||
|
||
WORKDIR /app | ||
# Add user | ||
RUN addgroup --gid $GROUP_ID $GROUP_NAME && \ | ||
adduser $USER_ID -u $USER_ID -D -G $GROUP_NAME -h $HOME | ||
|
||
# Install packages | ||
RUN apk update | ||
RUN apk add musl-dev gcc libpq-dev mariadb-connector-c-dev postgresql-dev python3-dev | ||
|
||
COPY python/src/requirements.txt ./python/src/ | ||
RUN pip install -r python/src/requirements.txt | ||
# Set working dir | ||
WORKDIR $HOME | ||
|
||
# Copy files and | ||
COPY --from=vue-build /app/dist ./dist | ||
COPY flask/src . | ||
|
||
# Install python packages | ||
RUN pip install --upgrade pip | ||
RUN pip install -r requirements.txt | ||
|
||
COPY python/ ./python/ | ||
# Open port | ||
EXPOSE $PORT | ||
|
||
COPY --from=frontend /app/dist /app/frontend | ||
# Set user | ||
USER $USER_ID | ||
|
||
EXPOSE 8000 | ||
CMD ["python", "python/src/main.py"] | ||
ENTRYPOINT ["python"] | ||
CMD ["main.py"] |
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,29 @@ | ||
FROM node:20-alpine | ||
|
||
ENV HOME=/app | ||
ENV FLASK_PORT=8080 | ||
ENV VITE_PORT=3000 | ||
|
||
RUN apk add python3 py3-pip musl-dev gcc libpq-dev mariadb-connector-c-dev postgresql-dev python3-dev | ||
|
||
WORKDIR $HOME/vue | ||
|
||
COPY ./vue/package*.json ./ | ||
|
||
RUN cd $HOME/vue && npm install | ||
|
||
COPY ./vue $HOME/vue | ||
|
||
WORKDIR $HOME/flask | ||
|
||
COPY ./flask/src $HOME/flask | ||
|
||
RUN pip install --upgrade pip --break-system-packages | ||
|
||
RUN pip install -r requirements.txt --break-system-packages | ||
|
||
EXPOSE $FLASK_PORT $VITE_PORT | ||
|
||
# EXPOSE $VITE_PORT | ||
# ENTRYPOINT ["sh", "-c", "cd /app/vue && npm run host"] | ||
ENTRYPOINT ["sh", "-c", "cd /app/flask && python main.py & cd /app/vue && npm run host"] |
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,18 @@ | ||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
|
||
ports: | ||
- "8080:8080" | ||
- "3000:3000" | ||
environment: | ||
DEBUG: True | ||
CHOKIDAR_USEPOLLING: true | ||
volumes: | ||
- ./vue:/app/vue:delegated | ||
- /app/vue/node_modules | ||
- ./flask/src/:/app/flask/ | ||
# - "./vue/:/app/vue/" | ||
command: sh -c "cd /app/flask && python main.py & cd /app/vue && npm run host" |
File renamed without changes.
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,11 @@ | ||
import logging | ||
|
||
from flask import Blueprint, jsonify | ||
|
||
logger = logging.getLogger(__name__) | ||
api_endpoints = Blueprint('api', __name__, url_prefix='/api') | ||
|
||
|
||
@api_endpoints.route('/status', methods=['GET']) | ||
def status(): | ||
return jsonify({"success": True, "message": "API is up and running"}) |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,8 @@ | ||
[pytest] | ||
minversion = 7.0 | ||
addopts = --cov=flask/src --cov-report term-missing | ||
pythonpath = flask/src | ||
testpaths = flask/tests | ||
env = | ||
DEBUG=False | ||
POD_NAME=test-pod |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
Oops, something went wrong.