general cleanup
Some checks failed
Build and publish the docker image / build (push) Failing after 1m16s

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn
2025-01-21 10:20:42 +03:00
parent f274ba527d
commit 58e9b94868
18 changed files with 100 additions and 361 deletions

View File

@ -1,41 +0,0 @@
# Multi-stage
# 1) Node image for building frontend assets
# 2) nginx stage to serve frontend assets
# Name the node stage "builder"
FROM docker.io/node:16 AS builder
# Set working directory
WORKDIR /app
# Filled with placeholders, later changed and managed
# by the substitute_environment_variables.sh file
ENV SAFETWITCH_BACKEND_DOMAIN SAFETWITCH_BACKEND_DOMAIN_PLACEHOLDER
ENV SAFETWITCH_INSTANCE_DOMAIN SAFETWITCH_INSTANCE_DOMAIN_PLACEHOLDER
ENV SAFETWITCH_HTTPS SAFETWITCH_HTTPS_PLACEHOLDER
ENV SAFETWITCH_DEFAULT_LOCALE SAFETWITCH_DEFAULT_LOCALE_PLACEHOLDER
ENV SAFETWITCH_FALLBACK_LOCALE SAFETWITCH_FALLBACK_LOCALE_PLACEHOLDER
ENV SAFETWITCH_DEFAULT_THEME SAFETWITCH_DEFAULT_THEME_PLACEHOLDER
# Copy all files from current directory to working dir in image
COPY ./ .
RUN ls
# install node modules and build assets
RUN npm i && npm run build
# nginx state for serving content
FROM docker.io/nginx:alpine
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
# Set working directory to nginx asset directory
RUN mkdir /app
# Copy static assets from builder stage
COPY --from=builder /app/dist /app
# Containers run nginx with global directives and daemon off
EXPOSE 8280
# Overriding the default NGINX container behavior
COPY ./docker/substitute_environment_variables.sh ./substitute_environment_variables.sh
RUN chmod +x /substitute_environment_variables.sh
ENTRYPOINT ["/substitute_environment_variables.sh"]

View File

@ -1,35 +0,0 @@
version: "3.7"
services:
safetwitch-frontend:
container_name: safetwitch-frontend
hostname: safetwitch-frontend
restart: always
build:
context: "../"
dockerfile: "./docker/Dockerfile"
ports:
- "127.0.0.1:8280:8280"
environment:
- SAFETWITCH_BACKEND_DOMAIN=localhost:7100
- SAFETWITCH_INSTANCE_DOMAIN=localhost:8280
- SAFETWITCH_HTTPS=true
- SAFETWITCH_DEFAULT_THEME=dark
- SAFETWITCH_DEFAULT_LOCALE=en-US
- SAFETWITCH_FALLBACK_LOCALE=en-US
safetwitch-backend:
container_name: safetwitch-backend
hostname: safetwitch-backend
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
restart: always
image: codeberg.org/safetwitch/safetwitch-backend:latest
ports:
- "127.0.0.1:7100:7000"
environment:
- PORT=7000
- URL=changeme

View File

@ -1,32 +1,32 @@
version: "3.7"
services:
safetwitch-frontend:
container_name: safetwitch-frontend
hostname: safetwitch-frontend
restart: always
image: codeberg.org/safetwitch/safetwitch:latest
st_frontend:
container_name: safetwitch_frontend
image: git.ngn.tf/ngn/safetwitch
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
ports:
- "127.0.0.1:8280:8280"
- 8080:8280
environment:
- SAFETWITCH_BACKEND_DOMAIN=changeme
- SAFETWITCH_INSTANCE_DOMAIN=changeme
- SAFETWITCH_HTTPS=true
- SAFETWITCH_DEFAULT_LOCALE=en
- SAFETWITCH_FALLBACK_LOCALE=en
- SAFETWITCH_BACKEND_DOMAIN=localhost:8081
- SAFETWITCH_INSTANCE_DOMAIN=localhost:8080
- SAFETWITCH_HTTPS=false
- SAFETWITCH_DEFAULT_LOCALE=en
- SAFETWITCH_FALLBACK_LOCALE=en
restart: unless-stopped
safetwitch-backend:
container_name: safetwitch-backend
hostname: safetwitch-backend
st_backend:
container_name: safetwitch_backend
image: codeberg.org/safetwitch/safetwitch-backend:latest
read_only: true
security_opt:
- no-new-privileges:true
- no-new-privileges:true
cap_drop:
- ALL
restart: always
image: codeberg.org/safetwitch/safetwitch-backend:latest
- ALL
ports:
- "127.0.0.1:7100:7000"
- 8081:7000
environment:
- PORT=7000
- URL=changeme
- PORT=7000
- URL=http://localhost:8081
restart: unless-stopped

View File