mirror of
https://github.com/maciejpedzich/six-degs-of-f1.git
synced 2024-11-27 15:55:47 +01:00
Create a Dockerfile and Docker Compose stack
This commit is contained in:
parent
5d8778f730
commit
40ba962e93
18
Dockerfile
Normal file
18
Dockerfile
Normal 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
35
compose.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user