initial
This commit is contained in:
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@ -0,0 +1,36 @@
|
||||
#
|
||||
# --- STAGE 1: Build ---
|
||||
#
|
||||
FROM dart:stable AS build
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copying all app recources
|
||||
COPY res/unpub-server .
|
||||
|
||||
# Install dependencies
|
||||
RUN dart pub get
|
||||
|
||||
# Create build directory
|
||||
RUN mkdir -p build
|
||||
|
||||
# Compiling the server
|
||||
RUN dart compile exe lib/server.dart -o build/server
|
||||
|
||||
#
|
||||
# --- STAGE 2: Runtime ---
|
||||
#
|
||||
FROM debian:bullseye-slim AS runtime
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Coping executable
|
||||
COPY --from=build /app/build/server .
|
||||
|
||||
# Expose http port, see docker-compose.yaml
|
||||
EXPOSE 8080
|
||||
|
||||
# Start server, when starting the container
|
||||
CMD ["./server"]
|
||||
Reference in New Issue
Block a user