Skip to content

Commit

Permalink
URL change and docker workspace path
Browse files Browse the repository at this point in the history
  • Loading branch information
mnerv committed Oct 21, 2024
1 parent 7ec299b commit 597035c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Build pdf using docker image
run: |
docker run --rm -v "$(pwd):/home/porter/app" --name maths --user root --hostname latex latex sh ./deploy.sh --parallel --production --dist-dir="web/dist" --cache-uri="https://maths.nrv.nu/pdf/archive.tar.gz"
docker run --rm -v "$(pwd):/app" --name maths --user root --hostname latex latex sh ./deploy.sh --parallel --production --dist-dir="web/dist" --cache-uri="https://notes.nrv.nu/pdf/archive.tar.gz"
- name: Upload site artifact
uses: actions/upload-pages-artifact@v2
Expand Down
25 changes: 15 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
FROM alpine:latest

RUN apk update && apk upgrade;\
apk add doas;\
adduser -g 'Porter' porter;\
echo "porter:" | chpasswd;\
adduser porter wheel;\
# Set environment variables for UID and GID (can be passed at runtime)
ARG USER_ID=1000
ARG GROUP_ID=1000

# Update packages and add required utilities
RUN apk update && apk upgrade; \
apk add doas; \
addgroup -g ${GROUP_ID} porter; \
adduser -D -u ${USER_ID} -G porter -g 'Porter' porter; \
echo "porter:" | chpasswd; \
addgroup porter wheel; \
echo "permit persist :wheel" > "/etc/doas.d/doas.conf"

# Run system config script
Expand All @@ -24,18 +30,17 @@ COPY compile.sh /home/porter
RUN chown -R porter /home/porter/.docker &&\
chown porter /home/porter/compile.sh

RUN mkdir -p /app
RUN chown -R porter /app

USER porter
WORKDIR /home/porter

## Set zsh as default shell
#RUN echo "porter:" | chsh -s $(which zsh) porter

# Run setup.sh as porter
RUN sh .docker/setup.sh

# Set final working directory
RUN mkdir -p /home/porter/app
WORKDIR /home/porter/app
WORKDIR /app

CMD ["zsh"]

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Math Notes
# Notes

Alpine container with LaTeX and neovim installation.

Expand All @@ -10,12 +10,16 @@ Build docker image.
docker build -t latex .
```

```sh
docker build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) -t latex .
```

## Run

Start latex docker image.

```sh
docker run -it --rm -v "$(pwd):/home/porter/app" --hostname latex --name maths latex
docker run -it --rm -v "$(pwd):/app" --name maths latex
```

## Python Environment
Expand Down
2 changes: 1 addition & 1 deletion web/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</div>
<div class='fixed bottom-0 right-0 p-4 hover:text-blue-nordic'>
<a class='mx-auto hover:underline hover:text-blue-400 transition-all duration-150 font-light'
href='https://github.com/mnerv/maths'
href='https://github.com/mnerv/notes'
title='Open Github repository'
target='_blank'>
<Icon icon="bi:github" />
Expand Down

0 comments on commit 597035c

Please sign in to comment.