Adds a multi-stage docker file to resolve #6 #10

Merged
dan merged 6 commits from NetworkString/server:add-multistage-dockerfile into trunk 2021-08-17 16:58:52 +00:00
Contributor

First stage pulls down Tor and compiles it.

Second stage compiles Cwtch.

Third stage creates a fresh alpine image and copies build artifacts from the first two stages and then incorporates the other files from docker etc.

First stage pulls down Tor and compiles it. Second stage compiles Cwtch. Third stage creates a fresh alpine image and copies build artifacts from the first two stages and then incorporates the other files from docker etc.
NetworkString added 2 commits 2021-08-10 12:01:31 +00:00
NetworkString changed title from Adds a multi-stage docker file to Adds a multi-stage docker file to resolve #6 2021-08-10 18:39:23 +00:00
Owner

requires #12 first

requires https://git.openprivacy.ca/cwtch.im/server/pulls/12 first
dan requested changes 2021-08-10 20:10:52 +00:00
dan left a comment
Owner

amazing work, thanks! just minor comments and requires #12 and should be good to go!

amazing work, thanks! just minor comments and requires #12 and should be good to go!
@ -0,0 +56,4 @@
COPY --from=cwtch-build-stage /go/src/app/app /usr/local/bin/cwtch
# Create unprivileged users
RUN mkdir -p /run/tor && mkdir /etc/cwtch && addgroup -S $TOR_USER && adduser -G $TOR_USER -S $TOR_USER && adduser -S $CWTCH_USER
Owner

switch /etc/cwtch to /var/lib/cwtch

switch /etc/cwtch to /var/lib/cwtch
NetworkString marked this conversation as resolved
@ -0,0 +65,4 @@
COPY ./docker/docker-entrypoint /usr/local/bin/
# Persist data
VOLUME /etc/tor /var/lib/tor /etc/cwtch
Owner

switch /etc/cwtch to /var/lib/cwtch

switch /etc/cwtch to /var/lib/cwtch
NetworkString marked this conversation as resolved
@ -0,0 +69,4 @@
ENTRYPOINT ["docker-entrypoint"]
#USER $CWTCH_USER
CMD ["/usr/local/bin/cwtch"]
Owner

should be like
env CWTCH_HOME=/var/lib/cwtch /usr/local/bin/cwtch --exportTofuBundle

should be like `env CWTCH_HOME=/var/lib/cwtch /usr/local/bin/cwtch --exportTofuBundle`
NetworkString marked this conversation as resolved
NetworkString added 1 commit 2021-08-10 20:26:08 +00:00
NetworkString added 1 commit 2021-08-10 21:07:00 +00:00
NetworkString added 1 commit 2021-08-10 21:11:31 +00:00
NetworkString added 1 commit 2021-08-13 18:09:58 +00:00
NetworkString requested review from dan 2021-08-13 18:10:12 +00:00
dan merged commit e5b760b77e into trunk 2021-08-17 16:58:52 +00:00
NetworkString deleted branch add-multistage-dockerfile 2021-08-17 22:00:04 +00:00
Sign in to join this conversation.
No reviewers
dan
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/server#10
No description provided.