Create a Dockerfile and Docker Compose stack

This commit is contained in:
Maciej Pędzich 2024-07-27 17:29:14 +02:00
parent 5d8778f730
commit 40ba962e93
Signed by: maciejpedzich
GPG Key ID: CE4A303D84882F0D
2 changed files with 53 additions and 0 deletions

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM node:lts-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
RUN npm run build
FROM node:lts-alpine AS runtime
USER node
WORKDIR /app
ENV NODE_ENV production
ENV HOST 0.0.0.0
ENV PORT 4321
COPY --chown=node:node package*.json ./
RUN npm ci --omit=dev
COPY --from=build --chown=node:node /app/dist ./dist
EXPOSE 4321
CMD ["node", "./dist/server/entry.mjs"]

35
compose.yml Normal file
View File

@ -0,0 +1,35 @@
networks:
private:
external: false
name: sixdegs
public:
external: true
name: $PUBLIC_NETWORK
volumes:
data:
name: sixdegs_data
driver: local
services:
# app:
# build:
# dockerfile: ./Dockerfile
# container_name: sixdegs
# hostname: sixdegs
# networks:
# - public
# - private
# restart: unless-stopped
# env_file: .env
# depends_on:
# - db
db:
image: memgraph/memgraph:2.18.1
container_name: sixdegs-db
hostname: sixdegs-db
networks:
- private
volumes:
- data:/var/lib/memgraph
restart: always