Skip to content

Commit

Permalink
Clean codebase -- switching to svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
rishikanthc committed Sep 27, 2024
1 parent 10bd648 commit 842afa0
Show file tree
Hide file tree
Showing 83 changed files with 54 additions and 9,505 deletions.
23 changes: 0 additions & 23 deletions Caddyfile

This file was deleted.

122 changes: 54 additions & 68 deletions Dockerfile
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 &
21 changes: 0 additions & 21 deletions frontend/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion frontend/.npmrc

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/.prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/.prettierrc

This file was deleted.

20 changes: 0 additions & 20 deletions frontend/ImagePreprocessor.js

This file was deleted.

38 changes: 0 additions & 38 deletions frontend/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions frontend/eslint.config.js

This file was deleted.

Loading

0 comments on commit 842afa0

Please sign in to comment.