forked from Ptt-official-app/Ptt-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (25 loc) · 760 Bytes
/
Dockerfile
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
30
31
32
33
34
35
36
37
38
39
FROM golang:1.17 as Builder
WORKDIR /root
COPY . .
RUN ./make.bash build
FROM golang:1.17 as Configure
WORKDIR /
RUN apt-get update && apt-get install xz-utils bzip2 && \
wget http://pttapp.cc/data-archives/bbs_backup_lastest.tar.xz && \
tar -Jxvf bbs_backup_lastest.tar.xz && \
wget http://pttapp.cc/data-archives/dump.shm.lastest.tar.bz2 && \
tar -jxvf dump.shm.lastest.tar.bz2
FROM golang:1.17
WORKDIR /
RUN groupadd -g 99 bbs && \
useradd -d /home/bbs \
--gid 99 \
--uid 9999 bbs
COPY --from=Configure /home/bbs/ /home/bbs/
COPY --from=Configure dump.shm .
COPY conf/ /conf/
COPY --from=Builder /root/Ptt-backend .
RUN chown bbs:bbs -R dump.shm conf
EXPOSE 8081/tcp
USER bbs
CMD [ "/Ptt-backend" ]