Skip to content

Commit

Permalink
Update Docker & nginx settings to allow secure connection
Browse files Browse the repository at this point in the history
  • Loading branch information
juhomakkonen committed Mar 21, 2024
1 parent 549a68e commit ecc747f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
.env.production.local

/ssl
/sertit

.prettierrc
/dist
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ FROM nginx:alpine
# Copy nginx conf file
COPY nginx.conf /etc/nginx/conf.d/default.conf

# Copy SSL sertificates
COPY ./sertit/star_turku_fi.crt /etc/nginx/star_turku_fi.crt
COPY ./sertit/star_turku_fi.key /etc/nginx/star_turku_fi.key

# Copy the built React app to Nginx's web server directory
COPY --from=build /app/dist /usr/share/nginx/html

# Expose port 80 for the Nginx server
EXPOSE 80
EXPOSE 443

# Start Nginx when the container runs
CMD ["nginx", "-g", "daemon off;"]
4 changes: 3 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
server {
listen 80;
listen 443 ssl;
ssl_certificate /etc/nginx/star_turku_fi.crt;
ssl_certificate_key /etc/nginx/star_turku_fi.key;
server_name liikkumistesti.turku.fi;
root /usr/share/nginx/html;
index index.html;
Expand Down

0 comments on commit ecc747f

Please sign in to comment.