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:
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:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- "api/**"
|
- "src/api/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-api:
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- "cdn/**"
|
- "src/cdn/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-cdn:
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- "gateway/**"
|
- "src/gateway/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-gw:
|
docker-gw:
|
||||||
|
12
Dockerfile
12
Dockerfile
@ -6,17 +6,21 @@ ENV WS_PORT=3002
|
|||||||
ENV CDN_PORT=3003
|
ENV CDN_PORT=3003
|
||||||
ENV RTC_PORT=3004
|
ENV RTC_PORT=3004
|
||||||
ENV ADMIN_PORT=3005
|
ENV ADMIN_PORT=3005
|
||||||
|
ENV THREADS=1
|
||||||
|
|
||||||
# exposed ports (only for reference, see https://docs.docker.com/engine/reference/builder/#expose)
|
# 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
|
EXPOSE ${HTTP_PORT}/tcp ${WS_PORT}/tcp ${CDN_PORT}/tcp ${RTC_PORT}/tcp ${ADMIN_PORT}/tcp
|
||||||
|
|
||||||
# install required apps
|
# install required apps
|
||||||
RUN apk add --no-cache --update git python3 py-pip make build-base
|
RUN apk add --no-cache --update git
|
||||||
RUN ln -s /usr/bin/python3 /usr/bin/python
|
|
||||||
|
|
||||||
# Run as non-root user
|
# Run as non-root user
|
||||||
# RUN adduser -D fosscord
|
# RUN adduser -D fosscord
|
||||||
# USER fosscord
|
# USER fosscord
|
||||||
|
|
||||||
WORKDIR /srv/fosscord-server/bundle
|
copy . /srv/fosscord-server/
|
||||||
ENTRYPOINT ["npm", "run", "start:bundle"]
|
|
||||||
|
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: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "3001-3005:3001-3005"
|
- "3001-3005:3001-3005"
|
||||||
volumes:
|
#volumes:
|
||||||
- ./:/srv/fosscord-server/
|
#- ./:/srv/fosscord-server/
|
||||||
environment:
|
environment:
|
||||||
THREADS: ${THREADS:-1}
|
THREADS: ${THREADS:-1}
|
||||||
HTTP_PORT: 3001
|
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