Prod container stuff

This commit is contained in:
ShootingStar91
2024-04-26 11:57:45 +03:00
parent b31c6b8f36
commit fb6b8bdc37
2 changed files with 35 additions and 0 deletions
+23
View File
@@ -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"]
+12
View File
@@ -7,6 +7,8 @@ services:
- ./frontend/:/usr/src/app
ports:
- 5173:5173
environment:
- BACKEND_URL=http://localhost:4000
now-db-backend:
container_name: nowdb-backend
image: node:20-alpine3.16
@@ -16,3 +18,13 @@ services:
- 4000:4000
command: >
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: