1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 12:42:44 +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/
db/
dist/
coverage/
*.db
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)
RUN apk add --no-cache \
make \
gcc \
g++ \
python \
cairo-dev \
jpeg-dev \
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
RUN apk add --no-cache make gcc g++ python cairo-dev jpeg-dev pango-dev giflib-dev
WORKDIR /usr/src/fosscord-server
COPY package.json .
COPY package-lock.json .
RUN npm rebuild bcrypt --build-from-source && npm install canvas --build-from-source
RUN npm install
COPY . .
EXPOSE 3001
RUN npm run build-docker
CMD ["node", "dist/start.js"]

View File

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