Skip to content

Commit 512b559

Browse files
chore: fix clean release.
The Dockerfile has an "optional" COPY statement that copies over generated development SSL certificates. However COPY fails when given no inputs. So on a clean repo it currently doesn't work. I'm removing the COPY statement from the Dockerfile and instead using (another) volume mount for that. Unfortunately that does require the certificate files to live in a subdirectory.
1 parent b98b779 commit 512b559

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
node_modules/
2+
cert/
23
package-lock.json
3-
cert.pem
4-
key.pem
5-
csr.pem

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ RUN yarn install --prod --immutable
99
COPY *.js ./
1010
COPY public public/
1111

12-
# SSL certificates. For testing only: doesn't match any files on a clean repo.
13-
COPY *.pem ./
14-
1512
EXPOSE 3000 9001 10000-11000
1613
CMD ["node", "main.js"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For local development you need to generate a self-signed certificate as voice me
2222

2323
With those files, you can run the server using:
2424

25-
export SSL_CERT_PATH="./cert.pem" SSL_KEY_PATH="./key.pem"
25+
export SSL_CERT_PATH="./cert/cert.pem" SSL_KEY_PATH="./cert/key.pem"
2626

2727
Or to wherever the key files are located on your production server.
2828

@@ -35,7 +35,7 @@ For running in production, make sure to set the `ANNOUNCED_IP` environmental var
3535
Proximity Chat can run in a Docker container. Use the following steps to build and run using Docker:
3636

3737
docker build -t proximity-chat .
38-
docker run -d -p 3000:3000 -p 9001:9001 -v "/$(pwd)\public":/usr/src/app/public:ro -e SSL_CERT_PATH="./cert.pem" -e SSL_KEY_PATH="./key.pem" proximity-chat
38+
docker run -d -p 3000:3000 -p 9001:9001 -v "/$(pwd)\public":/usr/src/app/public:ro -v "/$(pwd)\cert":/usr/src/app/cert:ro -e SSL_CERT_PATH="./cert/cert.pem" -e SSL_KEY_PATH="./cert/key.pem" proximity-chat
3939

4040
This also binds your local `public` directory to the container, so that you can test frontend changes more quickly.
4141

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"start": "node --trace-warnings main.js",
88
"lint": "eslint .",
99
"lint-fix": "eslint . --fix",
10-
"gen-ssl-certs": "openssl req -new -newkey rsa:2048 -nodes -keyout key.pem -x509 -out cert.pem -days 365 -subj /C=NL/ST=NB/L=Eindhoven/O=Disc/CN=www.demos.nl"
10+
"gen-ssl-certs": "openssl req -new -newkey rsa:2048 -nodes -keyout ./cert/key.pem -x509 -out ./cert/cert.pem -days 365 -subj /C=NL/ST=NB/L=Eindhoven/O=Disc/CN=www.demos.nl"
1111
},
1212
"author": "Meshiest",
1313
"license": "CC0 1.0 Universal",

0 commit comments

Comments
 (0)