mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-25 11:43:07 +01:00
Start of docker refactor
This commit is contained in:
parent
58111e9df4
commit
4e393a7bbe
2
.github/workflows/docker-publish-api.yml
vendored
2
.github/workflows/docker-publish-api.yml
vendored
@ -3,7 +3,7 @@ name: docker-publish-api
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "api/**"
|
||||
- "src/api/**"
|
||||
|
||||
jobs:
|
||||
docker-api:
|
||||
|
2
.github/workflows/docker-publish-cdn.yml
vendored
2
.github/workflows/docker-publish-cdn.yml
vendored
@ -3,7 +3,7 @@ name: docker-publish-cdn
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "cdn/**"
|
||||
- "src/cdn/**"
|
||||
|
||||
jobs:
|
||||
docker-cdn:
|
||||
|
2
.github/workflows/docker-publish-gateway.yml
vendored
2
.github/workflows/docker-publish-gateway.yml
vendored
@ -3,7 +3,7 @@ name: docker-publish-gw
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "gateway/**"
|
||||
- "src/gateway/**"
|
||||
|
||||
jobs:
|
||||
docker-gw:
|
||||
|
12
Dockerfile
12
Dockerfile
@ -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"]
|
@ -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
|
||||
|
3
scripts/docker-entrypoint.sh
Normal file
3
scripts/docker-entrypoint.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user