-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean codebase -- switching to svelte
- Loading branch information
1 parent
10bd648
commit 842afa0
Showing
83 changed files
with
54 additions
and
9,505 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 |
---|---|---|
@@ -1,68 +1,54 @@ | ||
# Use Python 3.11 as the base image | ||
FROM python:3.11-slim-bookworm | ||
|
||
# Install Node.js and other necessary tools | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
nodejs \ | ||
npm \ | ||
git \ | ||
ripgrep \ | ||
caddy \ | ||
build-essential && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Create a virtual environment and activate it, installing necessary packages there | ||
RUN python -m venv /opt/venv | ||
|
||
# Activate the virtual environment, upgrade pip within it, and install markopolis | ||
RUN /bin/sh -c ". /opt/venv/bin/activate && \ | ||
pip install --upgrade pip && \ | ||
pip install --no-cache-dir markopolis==2.0.3 && \ | ||
pip show markopolis" | ||
|
||
# Set up frontend | ||
WORKDIR /app/frontend | ||
COPY frontend/package*.json ./ | ||
RUN npm ci | ||
COPY frontend/ ./ | ||
|
||
# Build frontend | ||
|
||
ARG MARKOPOLIS_API_KEY | ||
ARG MARKOPOLIS_DOMAIN | ||
ARG MARKOPOLIS_FRONTEND_URL | ||
ARG MARKOPOLIS_MD_PATH | ||
ARG VITE_MARKOPOLIS_API_KEY | ||
ARG VITE_MARKOPOLIS_DOMAIN | ||
ENV VITE_MARKOPOLIS_API_KEY=$MARKOPOLIS_API_KEY | ||
ENV VITE_MARKOPOLIS_DOMAIN=$VITE_MARKOPOLIS_DOMAIN | ||
ENV MARKOPOLIS_API_KEY=$MARKOPOLIS_API_KEY | ||
ENV MARKOPOLIS_DOMAIN=$MARKOPOLIS_DOMAIN | ||
ENV MARKOPOLIS_FRONTEND_URL=$MARKOPOLIS_FRONTEND_URL | ||
ENV MARKOPOLIS_MD_PATH=$MARKOPOLIS_MD_PATH | ||
RUN npm run build | ||
|
||
# Copy Caddyfile | ||
COPY Caddyfile /etc/caddy/Caddyfile | ||
|
||
# Expose ports | ||
EXPOSE 80 8000 3000 | ||
|
||
# Create a startup script | ||
RUN echo '#!/bin/sh' > /start.sh && \ | ||
echo 'echo "Node.js version:"' >> /start.sh && \ | ||
echo 'node --version' >> /start.sh && \ | ||
echo 'echo "Python version:"' >> /start.sh && \ | ||
echo 'python --version' >> /start.sh && \ | ||
echo 'echo "Markopolis installation:"' >> /start.sh && \ | ||
echo '. /opt/venv/bin/activate && pip show markopolis' >> /start.sh && \ | ||
echo '. /opt/venv/bin/activate' >> /start.sh && \ | ||
echo 'markopolis run &' >> /start.sh && \ | ||
echo 'caddy run --config /etc/caddy/Caddyfile &' >> /start.sh && \ | ||
echo 'cd /app/frontend && node build' >> /start.sh && \ | ||
chmod +x /start.sh | ||
|
||
# Start services | ||
CMD ["/bin/sh", "-c", ". /opt/venv/bin/activate && exec /start.sh"] | ||
# Use Node.js alpine as the base image | ||
FROM node:18-alpine | ||
|
||
ARG PB_VERSION=0.22.21 | ||
|
||
RUN apk add --no-cache \ | ||
unzip \ | ||
ca-certificates | ||
|
||
# download and unzip PocketBase | ||
ADD https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip /tmp/pb.zip | ||
RUN unzip /tmp/pb.zip -d /pb/ | ||
|
||
# Uncomment to copy the local pb_migrations dir into the image | ||
# COPY ./pb_migrations /pb/pb_migrations | ||
|
||
# Uncomment to copy the local pb_hooks dir into the image | ||
# COPY ./pb_hooks /pb/pb_hooks | ||
|
||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Install SvelteKit dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the SvelteKit app's source code | ||
COPY . . | ||
|
||
# Expose the PocketBase HTTP port | ||
EXPOSE 8090 3000 | ||
|
||
# Copy the start.sh script into the container | ||
COPY start.sh /start.sh | ||
|
||
# Make the script executable | ||
RUN chmod +x /start.sh | ||
|
||
# Use the script to start PocketBase and create the admin user | ||
RUN ["/bin/sh", "/start.sh"] | ||
|
||
# Install supervisor | ||
RUN apk add --no-cache supervisor | ||
|
||
# Copy supervisor configuration | ||
COPY supervisord.conf /etc/supervisord.conf | ||
|
||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"] | ||
|
||
# CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8090", "--dev", "&&", "echo", "hello"] | ||
# CMD echo "hello" & \ | ||
# /pb/pocketbase serve --http=0.0.0.0:8090 --dev & \ | ||
# /usr/local/bin/node build & |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.