Semaphore/deployment/docker/dev/Dockerfile

39 lines
1.5 KiB
Docker
Raw Normal View History

2022-06-21 15:36:59 +02:00
FROM golang:1.18.3-alpine3.16
2018-03-12 01:35:24 +01:00
ENV SEMAPHORE_VERSION="development" SEMAPHORE_ARCH="linux_amd64" \
SEMAPHORE_CONFIG_PATH="${SEMAPHORE_CONFIG_PATH:-/etc/semaphore}" \
APP_ROOT="/go/src/github.com/ansible-semaphore/semaphore/"
2020-02-09 19:58:32 +01:00
# hadolint ignore=DL3013
RUN apk add --no-cache sshpass git mysql-client python3 py3-pip py-openssl openssl ca-certificates curl curl-dev openssh-client-default tini nodejs npm bash rsync && \
2020-09-30 13:40:29 +02:00
apk --update add --virtual build-dependencies python3-dev libffi-dev openssl-dev build-base &&\
2020-02-09 14:48:24 +01:00
rm -rf /var/cache/apk/*
2020-09-30 13:40:29 +02:00
RUN pip3 install --upgrade pip cffi && \
pip3 install ansible &&\
2020-02-09 14:48:24 +01:00
apk del build-dependencies
RUN adduser -D -u 1002 -g 0 semaphore && \
2018-03-12 01:35:24 +01:00
mkdir -p /go/src/github.com/ansible-semaphore/semaphore && \
mkdir -p /tmp/semaphore && \
mkdir -p /etc/semaphore && \
chown -R semaphore:0 /go && \
chown -R semaphore:0 /tmp/semaphore && \
chown -R semaphore:0 /etc/semaphore && \
ssh-keygen -t rsa -q -f "/root/.ssh/id_rsa" -N "" && \
2020-02-09 14:48:24 +01:00
ssh-keyscan -H github.com > /root/.ssh/known_hosts
RUN cd $(go env GOPATH) && curl -sL https://taskfile.dev/install.sh | sh
2018-03-12 01:35:24 +01:00
2022-06-23 16:05:48 +02:00
RUN git config --global --add safe.directory /go/src/github.com/ansible-semaphore/semaphore
2022-06-23 15:19:23 +02:00
2018-03-12 01:35:24 +01:00
# Copy in app source
WORKDIR ${APP_ROOT}
COPY . ${APP_ROOT}
2020-09-30 13:40:29 +02:00
RUN deployment/docker/dev/bin/install
2018-03-12 01:35:24 +01:00
2020-02-09 19:58:32 +01:00
USER semaphore
2018-03-12 01:35:24 +01:00
EXPOSE 3000
2020-02-09 19:58:32 +01:00
ENTRYPOINT ["/usr/local/bin/semaphore-wrapper"]
CMD ["./bin/semaphore", "server", "--config", "/etc/semaphore/config.json"]