Move resources to subdirectory to prevent confusion

A lot of people think they need to edit the config files in the main
directory and get confused. This change should prevent this confusion as
it moves these files out of user's focus.
parent 968f5ba9
...@@ -19,7 +19,7 @@ RUN apk add --no-cache --virtual .download wget ca-certificates && \ ...@@ -19,7 +19,7 @@ RUN apk add --no-cache --virtual .download wget ca-certificates && \
apk del .download apk del .download
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10
COPY gosu-gpg.key /tmp/gosu.key COPY resources/gosu-gpg.key /tmp/gosu.key
RUN set -ex; \ RUN set -ex; \
\ \
apk add --no-cache --virtual .gosu-deps \ apk add --no-cache --virtual .gosu-deps \
...@@ -47,7 +47,7 @@ RUN set -ex; \ ...@@ -47,7 +47,7 @@ RUN set -ex; \
apk del .gosu-deps apk del .gosu-deps
# Add configuraton files # Add configuraton files
COPY config.json .sequelizerc /files/ COPY resources/config.json resources/.sequelizerc /files/
# Install all dependencies and build project # Install all dependencies and build project
RUN apk add --no-cache --virtual .dep build-base python git bash && \ RUN apk add --no-cache --virtual .dep build-base python git bash && \
...@@ -76,7 +76,7 @@ WORKDIR /hackmd ...@@ -76,7 +76,7 @@ WORKDIR /hackmd
EXPOSE 3000 EXPOSE 3000
# Add entrypoint and set command # Add entrypoint and set command
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh COPY resources/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["node", "app.js"] CMD ["node", "app.js"]
...@@ -14,7 +14,7 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI ...@@ -14,7 +14,7 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10
COPY gosu-gpg.key /tmp/gosu.key COPY resources/gosu-gpg.key /tmp/gosu.key
RUN set -ex; \ RUN set -ex; \
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
...@@ -31,7 +31,7 @@ RUN set -ex; \ ...@@ -31,7 +31,7 @@ RUN set -ex; \
gosu nobody true gosu nobody true
# Add configuraton files # Add configuraton files
COPY config.json .sequelizerc /files/ COPY resources/config.json resources/.sequelizerc /files/
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y git build-essential && \ apt-get install -y git build-essential && \
...@@ -65,7 +65,7 @@ RUN apt-get update && \ ...@@ -65,7 +65,7 @@ RUN apt-get update && \
WORKDIR /hackmd WORKDIR /hackmd
EXPOSE 3000 EXPOSE 3000
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh COPY resources/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
......
...@@ -4,6 +4,8 @@ if [ "$HMD_DB_URL" = "" ]; then ...@@ -4,6 +4,8 @@ if [ "$HMD_DB_URL" = "" ]; then
HMD_DB_URL="postgres://hackmd:hackmdpass@hackmdPostgres:5432/hackmd" HMD_DB_URL="postgres://hackmd:hackmdpass@hackmdPostgres:5432/hackmd"
fi fi
export HMD_DB_URL
DB_SOCKET=$(echo ${HMD_DB_URL} | sed -e 's/.*:\/\//\/\//' -e 's/.*\/\/[^@]*@//' -e 's/\/.*$//') DB_SOCKET=$(echo ${HMD_DB_URL} | sed -e 's/.*:\/\//\/\//' -e 's/.*\/\/[^@]*@//' -e 's/\/.*$//')
if [ "$DB_SOCKET" != "" ]; then if [ "$DB_SOCKET" != "" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment