ci: docker build cleanup

pull/6775/head
NGPixel 2 years ago
parent e4efb38fbd
commit 3c28ac8092
No known key found for this signature in database
GPG Key ID: B755FB6870B30F63

@ -1,43 +0,0 @@
# =========================
# --- BUILD NPM MODULES ---
# =========================
FROM node:16-alpine AS build
RUN apk add yarn g++ make cmake python3 --no-cache
WORKDIR /wiki
COPY ./package.json ./package.json
RUN yarn --production --frozen-lockfile --non-interactive --network-timeout 100000
# ===============
# --- Release ---
# ===============
FROM node:16-alpine
LABEL maintainer="requarks.io"
RUN apk add bash curl git openssh gnupg sqlite --no-cache && \
mkdir -p /wiki && \
mkdir -p /logs && \
mkdir -p /wiki/data/content && \
chown -R node:node /wiki /logs
WORKDIR /wiki
COPY --chown=node:node ./build/assets ./assets
COPY --chown=node:node --from=build /wiki/node_modules ./node_modules
COPY --chown=node:node ./server ./server
COPY --chown=node:node ./build/server/views ./server/views
COPY --chown=node:node ./dev/build/config.yml ./config.yml
COPY --chown=node:node ./build/package.json ./package.json
COPY --chown=node:node ./LICENSE ./LICENSE
USER node
VOLUME ["/wiki/data/content"]
EXPOSE 3000
EXPOSE 3443
CMD ["node", "server"]

@ -1,32 +1,30 @@
# ====================
# --- Build Assets ---
# ====================
FROM node:16-alpine AS assets
FROM node:18-alpine AS assets
RUN apk add yarn g++ make cmake python3 --no-cache
RUN apk add g++ make cmake python3 --no-cache
WORKDIR /wiki
COPY ./client ./client
COPY ./ux
COPY ./dev ./dev
COPY ./package.json ./package.json
COPY ./.babelrc ./.babelrc
COPY ./.eslintignore ./.eslintignore
COPY ./.eslintrc.yml ./.eslintrc.yml
RUN yarn cache clean
RUN yarn --frozen-lockfile --non-interactive
RUN yarn build
RUN rm -rf /wiki/node_modules
RUN yarn --production --frozen-lockfile --non-interactive
RUN cd ux && \
npm ci --audit=false --fund=false
RUN npm run build
# ===============
# --- Release ---
# ===============
FROM node:16-alpine
FROM node:18-alpine
LABEL maintainer="requarks.io"
RUN apk add bash curl git openssh gnupg sqlite --no-cache && \
RUN apk add bash curl git openssh gnupg --no-cache && \
mkdir -p /wiki && \
mkdir -p /logs && \
mkdir -p /wiki/data/content && \
@ -35,20 +33,19 @@ RUN apk add bash curl git openssh gnupg sqlite --no-cache && \
WORKDIR /wiki
COPY --chown=node:node --from=assets /wiki/assets ./assets
COPY --chown=node:node --from=assets /wiki/node_modules ./node_modules
COPY --chown=node:node ./server ./server
COPY --chown=node:node --from=assets /wiki/server/views ./server/views
COPY --chown=node:node ./dev/build/config.yml ./config.yml
COPY --chown=node:node ./package.json ./package.json
COPY --chown=node:node ./LICENSE ./LICENSE
USER node
ENV NODE_ENV=production
RUN cd server && npm ci --omit=dev --audit=false --fund=false
VOLUME ["/wiki/data/content"]
EXPOSE 3000
EXPOSE 3443
# HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl -f http://localhost:3000/healthz
CMD ["node", "server"]

@ -1,13 +1,11 @@
port: 3000
bindIP: 0.0.0.0
db:
type: $(DB_TYPE)
host: '$(DB_HOST)'
port: $(DB_PORT)
port: $(DB_PORT:5432)
user: '$(DB_USER)'
pass: '$(DB_PASS)'
db: $(DB_NAME)
storage: $(DB_FILEPATH)
ssl: $(DB_SSL)
ssl:
enabled: $(SSL_ACTIVE)
@ -17,4 +15,3 @@ ssl:
subscriberEmail: $(LETSENCRYPT_EMAIL)
logLevel: $(LOG_LEVEL:info)
logFormat: $(LOG_FORMAT:default)
ha: $(HA_ACTIVE)

@ -1,18 +0,0 @@
# -- DEV DOCKERFILE --
# -- DO NOT USE IN PRODUCTION! --
FROM node:14
LABEL maintainer "requarks.io"
RUN apt-get update && \
apt-get install -y bash curl git python make g++ nano openssh-server gnupg && \
mkdir -p /wiki
WORKDIR /wiki
ENV dockerdev 1
ENV DEVDB postgres
EXPOSE 3000
CMD ["tail", "-f", "/dev/null"]

@ -1,10 +0,0 @@
port: 3000
bindIP: 0.0.0.0
db:
type: postgres
host: db
port: 5432
user: wikijs
pass: wikijsrocks
db: wiki
logLevel: info

@ -1,44 +0,0 @@
# -- DEV DOCKER-COMPOSE --
# -- DO NOT USE IN PRODUCTION! --
version: "3.8"
services:
db:
image: postgres:11-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_PASSWORD: wikijsrocks
POSTGRES_USER: wikijs
logging:
driver: "none"
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
pgadmin:
image: dpage/pgadmin4:latest
environment:
PGADMIN_DEFAULT_EMAIL: dev@js.wiki
PGADMIN_DEFAULT_PASSWORD: "123123"
PGADMIN_DISABLE_POSTFIX: true
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: False
network_mode: service:db
logging:
driver: "none"
wiki:
build:
context: ../..
dockerfile: dev/containers/Dockerfile
command: sleep infinity
depends_on:
- db
volumes:
- ../..:/workspace
network_mode: service:db
ipc: host
init: true
volumes:
db-data:

@ -1,33 +0,0 @@
version: "3"
services:
db:
image: postgres:11-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_PASSWORD: wikijsrocks
POSTGRES_USER: wikijs
logging:
driver: "none"
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
wiki:
image: requarks/wiki:2
depends_on:
- db
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_PASS: wikijsrocks
DB_NAME: wiki
restart: unless-stopped
ports:
- "80:3000"
- "443:3443"
volumes:
db-data:

@ -1,8 +0,0 @@
FROM requarks/wiki:2
USER root
RUN chgrp -R 0 /wiki /logs && \
chmod -R g=u /wiki /logs
USER 1001
Loading…
Cancel
Save