Skip to content

Commit 685b85b

Browse files
kasbahAbdulrhmnGhanem
authored andcommitted
Add a development Dockerfile
1 parent 64a8bb6 commit 685b85b

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

Dockerfile.gitea.dev

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
###################################
3+
#Build stage
4+
FROM golang:1.15-alpine3.12
5+
6+
ARG GOPROXY
7+
ENV GOPROXY ${GOPROXY:-direct}
8+
9+
ARG GITEA_VERSION
10+
ARG TAGS="sqlite sqlite_unlock_notify"
11+
ENV TAGS "bindata timetzdata $TAGS"
12+
ARG CGO_EXTRA_CFLAGS
13+
14+
#Build deps
15+
RUN apk --no-cache add build-base git nodejs npm
16+
17+
#Setup repo
18+
COPY . /go/src/code.gitea.io/gitea
19+
WORKDIR /go/src/code.gitea.io/gitea
20+
21+
#Checkout version if set
22+
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
23+
&& make clean-all build
24+
25+
EXPOSE 22 3000
26+
27+
RUN apk --no-cache add \
28+
bash \
29+
ca-certificates \
30+
curl \
31+
gettext \
32+
git \
33+
linux-pam \
34+
openssh \
35+
s6 \
36+
sqlite \
37+
su-exec \
38+
gnupg
39+
40+
RUN addgroup \
41+
-S -g 1000 \
42+
git && \
43+
adduser \
44+
-S -H -D \
45+
-h /data/git \
46+
-s /bin/bash \
47+
-u 1000 \
48+
-G git \
49+
git && \
50+
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
51+
52+
ENV USER git
53+
ENV GITEA_CUSTOM /data/gitea
54+
55+
VOLUME ["/data"]
56+
57+
ENTRYPOINT ["/usr/bin/entrypoint"]
58+
CMD ["/bin/s6-svscan", "/etc/s6"]
59+
60+
COPY docker/root /
61+
RUN mkdir -p /app/gitea
62+
RUN cp /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
63+
RUN ln -s /app/gitea/gitea /usr/local/bin/gitea

0 commit comments

Comments
 (0)