build(Dockerfile): SHOULD be done with Dockerfile, hopefully it builds
Some checks failed
/ build (push) Successful in 16m49s
/ deploy (push) Failing after 2s

This commit is contained in:
devaine 2026-05-11 00:26:20 -05:00
commit 12fd55f172
Signed by: devaine
GPG key ID: 954B1DCAC6FF84EE
6 changed files with 38 additions and 46 deletions

8
.dockerignore Normal file
View file

@ -0,0 +1,8 @@
# For development purposes only
**/node_modules
.env
**/dist
**/venv
*.log
**/__pycache__
docker-compose-dev.yml

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
venv
__pycache__
node_modules
docker-compose-dev.yml

View file

@ -2,33 +2,38 @@
# the application
FROM node:25-alpine
# WARNING: These ports are the default ports for the app, you should probably
# change them eventually, OR use docker-compose.yml to change them.
EXPOSE 8000
EXPOSE 3000
WORKDIR /app
RUN <<EOF
apk update
apk add python3
apk add bash
apk add --no-cache python3 bash py3-pip
EOF
# NOTE: Filesystem setup (probably needs COPY and WORKDIR)
COPY . /app
WORKDIR /app
SHELL ["/bin/bash", "-c"]
# NOTE: Frontend setup
COPY frontend/package.json frontend/package-lock.json ./frontend/
WORKDIR /app/frontend
RUN npm i
RUN npm run build
RUN npm ci && npx next telemetry disable
# NOTE: Backend setup
WORKDIR /app/api
RUN <<EOF
bash ./run.bash
EOF
COPY api/requirements.txt ./
RUN python3 -m venv venv
ENV PATH="/app/api/venv/bin:$PATH"
RUN <<EOF
pip install --no-cache-dir -U -r requirements.txt
pip install -U pip
EOF
# NOTE: Copy rest of the source code
WORKDIR /app
COPY . .
WORKDIR /app/frontend
RUN npm run build
EXPOSE 8000
EXPOSE 3000
WORKDIR /app
RUN "bash /app/run.bash"
ENTRYPOINT ["bash", "/app/start.bash"]

View file

@ -1,19 +0,0 @@
#!/bin/bash
#if [ ! -f .env ]; then
# env | grep DESEC_TOKEN >>.env
# env | grep CURRENT_DOMAIN >>.env
#fi
# If virtual environment does exist..
if [ ! -d venv ]; then
python3 -m venv venv
source venv/bin/activate
pip install -U -r requirements.txt
pip install -U pip
fi
# Assuming that your environemnt is already setup
if [ -d venv ]; then
pip install -U -r requirements.txt
fi

View file

@ -1,11 +0,0 @@
#!/bin/bash
source ./api/venv/bin/activate
cd ./frontend/ || exit
# NOTE: Hopefully this runs these two in the background.
npm run start &
(
cd ../api/src || exit
fastapi run
) &

8
start.bash Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
echo "$@"
if [[ $1 == "web" ]]; then
cd ./frontend/ && npm run start
elif [[ $1 == "api" ]]; then
cd ./api/ && source venv/bin/activate && cd ./src && fastapi run
fi