-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (32 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
46 lines (32 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Stage 1: Build the GO web and build server
FROM golang:1.23-alpine AS builder
# Install dependencies
RUN apk add --no-cache git curl bash
# Set up the working directory
WORKDIR /app
COPY ./server/. .
# Build the Go application
RUN go build -o docktainer
# Stage 2: Final container with Retype, Git and the Webserver
FROM mcr.microsoft.com/dotnet/sdk:9.0
# Install required tools
RUN apt-get update && apt-get install -y curl xz-utils git bash tar
ENV NODE_VERSION=20.14.0
RUN curl -fsSL https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz \
| tar -xJf - -C /usr/local --strip-components=1 --no-same-owner
RUN node -v && npm -v
# Install and Configure Retype
RUN dotnet tool install retypeapp --tool-path /bin
ENV RETYPE_DEFAULT_HOST="0.0.0.0"
# Set up Working Directory, and copy Web/Build Server from Builder
WORKDIR /app
COPY --from=builder /app/docktainer .
# Make the app executable
RUN chmod +x /app/docktainer
# Set up volumes
VOLUME /app/html
VOLUME /app/ssl
# Expose the default ports
EXPOSE 80 443
# Configure the start command
CMD ["sh", "-c", "./docktainer"]