mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 08:16:28 +00:00
improve docker build and wait for memcached
This commit is contained in:
parent
1d55d7f2d2
commit
9029f72a02
@ -1,2 +1,15 @@
|
|||||||
/**/target
|
*
|
||||||
/**/node_modules
|
!/entry.sh
|
||||||
|
|
||||||
|
!/backend/src
|
||||||
|
!/backend/Cargo.lock
|
||||||
|
!/backend/Cargo.toml
|
||||||
|
|
||||||
|
!/frontend/locales
|
||||||
|
!/frontend/src
|
||||||
|
!/frontend/static
|
||||||
|
!/frontend/.npmrc
|
||||||
|
!/frontend/package.json
|
||||||
|
!/frontend/pnpm-lock.yaml
|
||||||
|
!/frontend/svelte.config.js
|
||||||
|
!/frontend/tsconfig.json
|
||||||
|
27
Dockerfile
27
Dockerfile
@ -1,31 +1,26 @@
|
|||||||
# Frontend
|
# FRONTEND
|
||||||
FROM node:16-alpine as CLIENT
|
FROM node:16-alpine as client
|
||||||
|
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
COPY ./frontend ./
|
|
||||||
|
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
COPY ./frontend ./
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# Backend
|
|
||||||
FROM rust:1.59-alpine as RUST
|
|
||||||
|
|
||||||
|
# BACKEND
|
||||||
|
FROM rust:1.61-alpine as backend
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
RUN apk add libc-dev openssl-dev alpine-sdk
|
RUN apk add libc-dev openssl-dev alpine-sdk
|
||||||
COPY ./backend ./
|
COPY ./backend ./
|
||||||
|
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
# Server
|
|
||||||
|
# RUNNER
|
||||||
FROM alpine
|
FROM alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=RUST /tmp/target/release/cryptgeon .
|
COPY ./entry.sh .
|
||||||
COPY --from=CLIENT /tmp/build ./frontend/build
|
COPY --from=backend /tmp/target/release/cryptgeon .
|
||||||
|
COPY --from=client /tmp/build ./frontend/build
|
||||||
ENV MEMCACHE=memcached:11211
|
ENV MEMCACHE=memcached:11211
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
ENTRYPOINT [ "/app/entry.sh" ]
|
||||||
ENTRYPOINT [ "/app/cryptgeon" ]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user