-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (26 loc) · 949 Bytes
/
Dockerfile
File metadata and controls
29 lines (26 loc) · 949 Bytes
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
# Compile outside Docker and run
# Debian stable and slim don't work, throwing a glibc error
FROM ubuntu:latest
WORKDIR /app
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends openssl ca-certificates \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# ENVIRONMENT equaling `production` is required for sqlx to run offline and migrate properly
ENV ENVIRONMENT production
COPY ./target/release/zero2prod .
# Configuration files are copied over but will be overwritten by environment variables injected from the PaaS or server
COPY ./configuration ./configuration
COPY ./migrations ./migrations
ENTRYPOINT ["./zero2prod"]
EXPOSE 8080
# # Compile inside Docker and run
# FROM rust:latest
# WORKDIR /app
# RUN apt update && apt install lld clang -y
# COPY . .
# ENV SQLX_OFFLINE true
# RUN cargo build --release
# ENV ENVIRONMENT production
# ENTRYPOINT ["./target/release/zero2prod"]