mirror of
https://github.com/He4eT/simple-spaceapi.git
synced 2026-05-05 01:47:24 +00:00
docker: initial commit
This commit is contained in:
parent
00e62feaa2
commit
42c322449d
3 changed files with 45 additions and 0 deletions
9
.dockerignore
Normal file
9
.dockerignore
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
.cache/
|
||||||
|
.git/
|
||||||
|
.tmp/
|
||||||
|
build/
|
||||||
|
data/
|
||||||
|
dist/
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
.env
|
||||||
20
Dockerfile
Normal file
20
Dockerfile
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
FROM node:22-alpine
|
||||||
|
# RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
|
||||||
|
|
||||||
|
ARG NODE_ENV=production
|
||||||
|
ENV NODE_ENV=$NODE_ENV
|
||||||
|
ENV PATH=/app/node_modules/.bin:$PATH
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci --only=production
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN chown -R node:node /app
|
||||||
|
USER node
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
EXPOSE 1337
|
||||||
|
CMD ["npm", "run", "start"]
|
||||||
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
services:
|
||||||
|
simple-spaceapi:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "1337:1337"
|
||||||
|
volumes:
|
||||||
|
- ./data/base:/app/data/base
|
||||||
|
- ./data/uploads:/app/public/uploads
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
environment:
|
||||||
|
- DATABASE_CLIENT=sqlite
|
||||||
|
- DATABASE_FILENAME=data/base/sqlite.db
|
||||||
|
- NODE_ENV=production
|
||||||
|
- STRAPI_TELEMETRY_DISABLED=true
|
||||||
|
restart: unless-stopped
|
||||||
Loading…
Add table
Add a link
Reference in a new issue