2024-11-29 02:53:24 -08:00
|
|
|
FROM rust:1.71.0-alpine
|
2021-04-09 15:24:47 -07:00
|
|
|
|
2024-11-29 02:53:24 -08:00
|
|
|
# Install git and other necessary dependencies using apk
|
2024-11-29 01:16:28 -08:00
|
|
|
RUN apk update && apk add --no-cache git
|
2021-04-09 15:24:47 -07:00
|
|
|
|
2024-11-29 01:15:03 -08:00
|
|
|
# Set the working directory to /build
|
2024-11-29 01:10:45 -08:00
|
|
|
WORKDIR /build
|
2024-11-29 00:09:36 -08:00
|
|
|
|
2024-11-29 01:10:45 -08:00
|
|
|
# Clone the redlib repository
|
|
|
|
RUN git clone https://github.com/LucifersCircle/redlib.git /build
|
2024-11-29 00:18:32 -08:00
|
|
|
|
2024-11-29 01:10:45 -08:00
|
|
|
# Checkout the main branch
|
|
|
|
RUN cd /build && git checkout main
|
2024-11-29 00:09:36 -08:00
|
|
|
|
2024-11-29 01:15:03 -08:00
|
|
|
# Set the final image's default user
|
2023-12-26 18:25:52 -05:00
|
|
|
RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
|
|
|
|
USER redlib
|
2021-04-09 15:24:47 -07:00
|
|
|
|
2024-11-29 01:15:03 -08:00
|
|
|
# Expose the necessary port
|
2021-02-24 20:17:36 +01:00
|
|
|
EXPOSE 8080
|
2021-04-09 15:24:47 -07:00
|
|
|
|
2024-11-29 01:15:03 -08:00
|
|
|
# Set the default command to run the application
|
2024-11-29 01:10:45 -08:00
|
|
|
CMD ["redlib"]
|