mirror of
https://github.com/serge-chat/serge.git
synced 2024-01-15 09:32:12 +03:00
36 lines
993 B
Docker
36 lines
993 B
Docker
# ---------------------------------------
|
|
# Base image for node
|
|
FROM node:19-bullseye-slim as node_base
|
|
|
|
# ---------------------------------------
|
|
# Base image for dragonflydb
|
|
FROM ghcr.io/dragonflydb/dragonfly:v1.7.1 as dragonfly
|
|
|
|
# ---------------------------------------
|
|
# Dev environment
|
|
FROM python:3.11-slim-bullseye as dev
|
|
|
|
# Set ENV
|
|
WORKDIR /usr/src/app
|
|
ENV TZ=Etc/UTC
|
|
ENV NODE_ENV='development'
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y cmake build-essential dumb-init \
|
|
&& pip install --upgrade pip
|
|
|
|
# Copy database, source code, and scripts
|
|
COPY --from=dragonfly /usr/local/bin/dragonfly /usr/local/bin/dragonfly
|
|
COPY --from=node_base /usr/local /usr/local
|
|
COPY scripts/dev.sh /usr/src/app/dev.sh
|
|
COPY ./web/package.json ./web/package-lock.json ./
|
|
|
|
RUN npm ci \
|
|
&& chmod 755 /usr/src/app/dev.sh \
|
|
&& chmod 755 /usr/local/bin/dragonfly
|
|
|
|
EXPOSE 8008
|
|
EXPOSE 9124
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
CMD ["/bin/bash", "-c", "/usr/src/app/dev.sh"]
|