docker: Fix permission issues, remove user from container

This commit is contained in:
Valentin Tolmer
2021-11-27 20:19:55 +01:00
committed by nitnelave
parent 9653d64eb1
commit 6191fb226a
3 changed files with 32 additions and 18 deletions
+8 -18
View File
@@ -42,26 +42,16 @@ RUN cargo build --release -p lldap \
# Final image
FROM alpine:3.14
RUN set -x \
# Add user
&& addgroup --gid 10001 app \
&& adduser --disabled-password \
--gecos '' \
--ingroup app \
--home /app \
--uid 10001 \
app \
# Create the /data folder
&& mkdir /data && chown app:app /data \
&& apk add --no-cache bash
USER app
WORKDIR /app
COPY --chown=app:app --from=builder /app/app/index.html /app/app/main.js /app/app/style.css app/
COPY --chown=app:app --from=builder /app/app/pkg app/pkg
COPY --chown=app:app --from=builder /app/target/release/lldap lldap
COPY docker-entrypoint.sh .
COPY --from=builder /app/app/index.html /app/app/main.js /app/app/style.css app/
COPY --from=builder /app/app/pkg app/pkg
COPY --from=builder /app/target/release/lldap lldap
COPY docker-entrypoint.sh lldap_config.docker_template.toml ./
RUN set -x \
&& apk add --no-cache bash \
&& chmod a+r -R .
ENV LDAP_PORT=3890
ENV HTTP_PORT=17170