mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Prod container stuff
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
FROM node:20-alpine3.19 AS build
|
||||||
|
|
||||||
|
ENV TZ="Europe/Helsinki"
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:20-alpine3.19 AS node-run
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=build /app/dist /app
|
||||||
|
|
||||||
|
EXPOSE 4000
|
||||||
|
|
||||||
|
CMD ["node build/index.js"]
|
||||||
@@ -7,6 +7,8 @@ services:
|
|||||||
- ./frontend/:/usr/src/app
|
- ./frontend/:/usr/src/app
|
||||||
ports:
|
ports:
|
||||||
- 5173:5173
|
- 5173:5173
|
||||||
|
environment:
|
||||||
|
- BACKEND_URL=http://localhost:4000
|
||||||
now-db-backend:
|
now-db-backend:
|
||||||
container_name: nowdb-backend
|
container_name: nowdb-backend
|
||||||
image: node:20-alpine3.16
|
image: node:20-alpine3.16
|
||||||
@@ -16,3 +18,13 @@ services:
|
|||||||
- 4000:4000
|
- 4000:4000
|
||||||
command: >
|
command: >
|
||||||
sh -c "cd /usr/src/app && npm ci && npx tsc && npm run start"
|
sh -c "cd /usr/src/app && npm ci && npx tsc && npm run start"
|
||||||
|
now-db:
|
||||||
|
container_name: nowdb-db
|
||||||
|
image: mariadb
|
||||||
|
env_file: .db.dev.env
|
||||||
|
volumes:
|
||||||
|
- ./data/:/docker-entrypoint-initdb.d
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:3306:3306
|
||||||
|
volumes:
|
||||||
|
nowdb-db:
|
||||||
|
|||||||
Reference in New Issue
Block a user