Skip to content

Commit

Permalink
corect path Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
scammo committed Jan 4, 2024
1 parent 8d1e830 commit 19c3672
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 261 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,26 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
- name: Build Frontend
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
file: frontend/Dockerfile
push: true
tags: "ghcr.io/${{ github.repository }}:latest"
tags: "ghcr.io/${{ github.repository }}/frontend:latest"

- name: pull and start new image
uses: appleboy/ssh-action@master
- name: Build Backend
uses: docker/build-push-action@v3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER_NAME }}
key: ${{ secrets.PRIVATE_KEY}}
script: cd ccs-proposal && docker compose pull && docker compose up -d
context: .
file: backend/Dockerfile
push: true
tags: "ghcr.io/${{ github.repository }}/backend:latest"

# - name: pull and start new image
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USER_NAME }}
# key: ${{ secrets.PRIVATE_KEY}}
# script: cd pretty-good-proposal-v2 && docker compose pull && docker compose up -d
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Pretty Good Proposal V2

## Live Structure

frontend: bewerben.c3fl.de
backend: api.bewerben.c3fl.de
3 changes: 0 additions & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ RUN apk add --no-cache \
COPY ./ /var/www/html

RUN composer install --optimize-autoloader --no-interaction --no-dev --ignore-platform-req=ext-intl
RUN npm ci
RUN npm run build
RUN rm -rf node_modules

FROM unit:php8.2

Expand Down
30 changes: 30 additions & 0 deletions backend/docker/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"listeners": {
"*:80": {
"pass": "routes"
}
},
"routes": [
{
"match": {
"uri": "!/index.php"
},
"action": {
"share": "/var/www/html/public$uri",
"response_headers": {
"Cache-Control": "max-age=60, s-maxage=120"
},
"fallback": {
"pass": "applications/laravel"
}
}
}
],
"applications": {
"laravel": {
"type": "php",
"root": "/var/www/html/public/",
"script": "index.php"
}
}
}
12 changes: 12 additions & 0 deletions backend/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

cd /var/www/html && mkdir -p storage/framework/{sessions,views,cache}
cd /var/www/html && php artisan storage:link
cd /var/www/html && php artisan optimize:clear
cd /var/www/html && php artisan config:cache
cd /var/www/html && php artisan route:cache
cd /var/www/html && php artisan view:cache
cd /var/www/html && php artisan event:cache
cd /var/www/html && php artisan migrate --force

exec "$@"
46 changes: 46 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: "3"

networks:
web:
external: true

volumes:
storage:

services:
backend:
image: ghcr.io/chaostreff-flensburg/simple-borrow:latest
restart: always
volumes:
- storage:/var/www/html/storage
labels:
- "traefik.enable=true"
- "traefik.http.routers.ausleihe.rule=Host(`api.bewerben.c3fl.de`)"
- "traefik.http.routers.ausleihe.entrypoints=https,http"
- "traefik.http.services.ausleihe.loadbalancer.server.port=80"
- "traefik.http.routers.ausleihe.tls.certresolver=mytlschallenge"
- "traefik.docker.network=web"
working_dir: /var/www/html
networks:
- web
env_file:
- .env
logging:
options:
max-size: "10m"

frontend:
image: ghcr.io/chaostreff-flensburg/simple-borrow:latest
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.ausleihe.rule=Host(`bewerben.c3fl.de`)"
- "traefik.http.routers.ausleihe.entrypoints=https,http"
- "traefik.http.services.ausleihe.loadbalancer.server.port=80"
- "traefik.http.routers.ausleihe.tls.certresolver=mytlschallenge"
- "traefik.docker.network=web"
networks:
- web
logging:
options:
max-size: "10m"
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:alpine as builder
WORKDIR /app
ADD . .
# Needs to be set to the backend url
ENV VITE_BACKEND_URL=https://bewerben.c3fl.de/api
ENV VITE_BACKEND_URL=https://api.bewerben.c3fl.de

RUN npm ci && npm run build

Expand Down
4 changes: 0 additions & 4 deletions frontend/supabase/.gitignore

This file was deleted.

82 changes: 0 additions & 82 deletions frontend/supabase/config.toml

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/supabase/functions/.vscode/extensions.json

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/supabase/functions/.vscode/settings.json

This file was deleted.

Loading

0 comments on commit 19c3672

Please sign in to comment.