mirror of
https://codeberg.org/SafeTwitch/safetwitch.git
synced 2024-12-21 21:03:00 -05:00
docker fixes
This commit is contained in:
parent
a2eff6e427
commit
91d8b79e58
3 changed files with 42 additions and 3 deletions
|
@ -16,14 +16,18 @@ 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 ../ .
|
||||
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 ./nginx.conf /etc/nginx/nginx.conf
|
||||
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
|
||||
# Set working directory to nginx asset directory
|
||||
RUN mkdir /app
|
||||
# Copy static assets from builder stage
|
||||
|
@ -32,6 +36,6 @@ COPY --from=builder /app/dist /app
|
|||
EXPOSE 8280
|
||||
|
||||
# Overriding the default NGINX container behavior
|
||||
COPY ./substitute_environment_variables.sh ./substitute_environment_variables.sh
|
||||
COPY ./docker/substitute_environment_variables.sh ./substitute_environment_variables.sh
|
||||
RUN chmod +x /substitute_environment_variables.sh
|
||||
ENTRYPOINT ["/substitute_environment_variables.sh"]
|
35
docker/docker-compose.build.yml
Normal file
35
docker/docker-compose.build.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
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
|
Loading…
Reference in a new issue