1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 02:12:40 +01:00

Start of docker refactor

This commit is contained in:
TheArcaneBrony 2022-09-07 08:53:13 +02:00
parent 58111e9df4
commit 4e393a7bbe
No known key found for this signature in database
GPG Key ID: 32FC5AAADAD75A22
7 changed files with 16 additions and 9 deletions

View File

@ -3,7 +3,7 @@ name: docker-publish-api
on:
push:
paths:
- "api/**"
- "src/api/**"
jobs:
docker-api:

View File

@ -3,7 +3,7 @@ name: docker-publish-cdn
on:
push:
paths:
- "cdn/**"
- "src/cdn/**"
jobs:
docker-cdn:

View File

@ -3,7 +3,7 @@ name: docker-publish-gw
on:
push:
paths:
- "gateway/**"
- "src/gateway/**"
jobs:
docker-gw:

View File

@ -6,17 +6,21 @@ ENV WS_PORT=3002
ENV CDN_PORT=3003
ENV RTC_PORT=3004
ENV ADMIN_PORT=3005
ENV THREADS=1
# exposed ports (only for reference, see https://docs.docker.com/engine/reference/builder/#expose)
EXPOSE ${HTTP_PORT}/tcp ${WS_PORT}/tcp ${CDN_PORT}/tcp ${RTC_PORT}/tcp ${ADMIN_PORT}/tcp
# install required apps
RUN apk add --no-cache --update git python3 py-pip make build-base
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN apk add --no-cache --update git
# Run as non-root user
# RUN adduser -D fosscord
# USER fosscord
WORKDIR /srv/fosscord-server/bundle
ENTRYPOINT ["npm", "run", "start:bundle"]
copy . /srv/fosscord-server/
WORKDIR /srv/fosscord-server
RUN chmod +x scripts/docker-entrypoint.sh
run rm -rf assets/cache/
ENTRYPOINT ["scripts/docker-entrypoint.sh"]

View File

@ -8,8 +8,8 @@ services:
build: .
ports:
- "3001-3005:3001-3005"
volumes:
- ./:/srv/fosscord-server/
#volumes:
#- ./:/srv/fosscord-server/
environment:
THREADS: ${THREADS:-1}
HTTP_PORT: 3001

View File

@ -0,0 +1,3 @@
#!/bin/sh
if [ ! -d "node_modules" ]; then apk add --no-cache --update python3 py-pip make gcc; ln -s /usr/bin/python3 /usr/bin/python; npm run setup; fi
if [ ! -d 'dist' ]; then npm run build; fi