-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Base setup for Frontend Docker image (#279)
* feat: Add files needed to build a Docker image * docs: Add setup instructions for the frontend * feat: Add workflow to automatically build a docker image * fix(docker): Use the `--no-cache` switch to avoid the need to use `--update` and remove `/var/cache/apk/*` From https://www.codefactor.io/repository/github/ree6-applications/webinterface/pull/279 * fix(CI/CD): obsolete name for workflow job * feat(docker): Support environment variables was added, new image name There's no longer a need for the `start.sh` script Names for the docker images were changed to use the project's name --------- Co-authored-by: Presti <dxssucuk@hotmail.com>
- Loading branch information
Showing
4 changed files
with
138 additions
and
2 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
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Created by "Jiří Štefka <jiri@stefka.eu>" | ||
# This code is under the GPLv3 license. | ||
FROM node:18-alpine | ||
|
||
LABEL developer="Jiří Štefka <jiri@stefka.eu>" | ||
LABEL maintainer="Jiří Štefka <jiri@stefka.eu>" | ||
|
||
# Install git (needed to download the Frontend) | ||
RUN apk add --no-cache git | ||
|
||
# Clone Ree6 frontend | ||
RUN git clone https://github.com/Ree6-Applications/Webinterface /Webinterface | ||
|
||
# Setup the files and permissions | ||
RUN chown -R node:node /Webinterface | ||
USER node:node | ||
WORKDIR /Webinterface/Frontend | ||
|
||
# Install the needed modules | ||
RUN npm install vite && npm install && npm i -D @sveltejs/adapter-node --force | ||
|
||
# Patch the config to use the node adapter | ||
RUN sed -i "s@import adapter from '\@sveltejs/adapter-auto';@import adapter from '\@sveltejs/adapter-node';@g" svelte.config.js | ||
|
||
RUN npm run build | ||
RUN rm -rf src/ static/ | ||
|
||
CMD ["node", "build/index.js"] |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: "3" | ||
# Created by "Jiří Štefka <jiri@stefka.eu>" | ||
# This code is under the GPLv3 license. | ||
|
||
services: | ||
ree6_frontend: | ||
container_name: ree6_frontend | ||
image: ree6/frontend | ||
|
||
environment: | ||
- BACKEND_URL="https://api.ree6.de" # Change this to use your backend url | ||
- INVITE_URL="https://invite.ree6.de" # Change this to your bot's invite link | ||
|
||
- HOST=0.0.0.0 # IP address to listen to | ||
|
||
- TZ=Europe/Prague # Set your timezone | ||
- NODE_ENV=production # Internal server error messages will not send stacktrace to the browser in production | ||
|
||
# Uncomment the lines below to enable Traefik | ||
# Don't forget to uncomment the bottom of the file as well | ||
# Don't forget to comment out the `ports` section | ||
# labels: | ||
# - traefik.http.routers.ree6_frontend.rule=Host(`ree6.example.com`) # Set to your domain (+subdomain) | ||
# - traefik.http.routers.ree6_frontend.entrypoints=websecure | ||
# - traefik.http.routers.ree6_frontend.tls.certresolver=lets-encrypt | ||
# - traefik.http.routers.ree6_frontend.service=ree6_frontend | ||
# - traefik.http.services.ree6_frontend.loadBalancer.server.port=3000 # Must be same as `PORT` variable | ||
# networks: | ||
# - traefik | ||
ports: # Comment this out if using traefik | ||
- 3000:3000 # Comment this out if using traefik | ||
|
||
restart: unless-stopped | ||
|
||
# Uncomment this for Traefik | ||
# networks: | ||
# traefik: | ||
# external: true |