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

Revert "fix: make API dockerfile use correct setup steps"

This reverts commit aae55cfe71.
This commit is contained in:
Flam3rboy 2021-10-18 14:36:57 +02:00
parent 508fbce94e
commit 435e67b7a9
5 changed files with 19 additions and 72 deletions

1
.docker/env Normal file
View File

@ -0,0 +1 @@
MONGO_URL=mongodb://db:27017/fosscord?readPreference=secondaryPreferred

View File

@ -1,5 +1,2 @@
node_modules/ node_modules/
db/ db/
dist/
coverage/
*.db

View File

@ -1,6 +0,0 @@
PRODUCTION=false
DATABASE="postgres://fosscord:fosscord@db:5432/fosscord"
STORAGE_PROVIDER=file
STORAGE_LOCATION=/data

View File

@ -1,29 +1,12 @@
FROM node:lts-alpine AS builder FROM node:lts-alpine
# needed for native packages (bcrypt, canvas) # needed for native packages (bcrypt, canvas)
RUN apk add --no-cache \ RUN apk add --no-cache make gcc g++ python cairo-dev jpeg-dev pango-dev giflib-dev
make \ WORKDIR /usr/src/fosscord-server
gcc \ COPY package.json .
g++ \ COPY package-lock.json .
python \ RUN npm rebuild bcrypt --build-from-source && npm install canvas --build-from-source
cairo-dev \ RUN npm install
jpeg-dev \ COPY . .
pango-dev \
giflib-dev
WORKDIR /usr/src/api
RUN npm rebuild bcrypt --build-from-source \
&& npm install canvas --build-from-source
COPY api/package.json api/package-lock.json ./
COPY util ../util
RUN cd ../util && npm install && cd ../api && npm install
COPY api/ .
RUN npm run build
EXPOSE 3001 EXPOSE 3001
RUN npm run build-docker
CMD ["node", "dist/start.js"] CMD ["node", "dist/start.js"]

View File

@ -1,52 +1,24 @@
---
version: "3" version: "3"
services: services:
db: db:
hostname: fosscord_db hostname: fosscord_db
image: postgres:latest image: mongo:latest
volumes: volumes:
- db_data:/var/lib/postgres - ./db:/data/db
restart: unless-stopped restart: unless-stopped
ports:
- 5432:5432
environment:
POSTGRES_USER: fosscord
POSTGRES_DATABASE: fosscord
POSTGRES_PASSWORD: fosscord
api: api:
build: hostname: fosscord_api
context: . image: fosscord/api
dockerfile: api/Dockerfile
depends_on: depends_on:
- db - db
ports: ports:
- 3001:3001 - 3001:3001
env_file: .env env_file: ./.docker/env
gateway: gateway:
build: hostname: fosscord_gateway
context: . image: fosscord/gateway
dockerfile: gateway/Dockerfile
depends_on: depends_on:
- db - db
ports: ports:
- 3002:3002 - 3002:3002
env_file: .env env_file: ./.docker/env
cdn:
build:
context: .
dockerfile: cdn/Dockerfile
depends_on:
- db
ports:
- 3003:3003
volumes:
- cdn_data:/data
env_file: .env
volumes:
db_data: {}
cdn_data: {}