Commit 6ce15198 authored by Mark Harding's avatar Mark Harding
Browse files

(feat): updates to docker containers

parent ad16763e
......@@ -11,8 +11,8 @@ RUN go get -u \
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o bin/ecs-deploy
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /bin/ecs-deploy
ENV AWS_SDK_LOAD_CONFIG=1
CMD [ "./bin/ecs-deploy" ]
CMD [ "/bin/ecs-deploy" ]
......@@ -4,7 +4,6 @@ import (
"fmt"
"os"
"github.com/Sirupsen/logrus"
"github.com/joho/godotenv"
"github.com/urfave/cli"
)
......@@ -56,7 +55,7 @@ func main() {
}
if err := app.Run(os.Args); err != nil {
logrus.Fatal(err)
fmt.Println("Error", err);
}
}
......
......@@ -111,7 +111,8 @@ func (p *Plugin) updateService(taskDefinitionArn string) error {
return nil
}
return p.wait();
//return p.wait();
return nil
}
func (p *Plugin) updateTaskDefinition(taskDefinition *ecs.TaskDefinition) (string, error) {
......
FROM nginx:1.13-alpine
RUN rm /etc/nginx/conf.d/default.conf
COPY ./minds.conf /etc/nginx/conf.d/minds.conf
\ No newline at end of file
COPY nginx.conf /etc/nginx/nginx.conf
COPY ./minds.conf /etc/nginx/conf.d/minds.conf
......@@ -7,9 +7,18 @@ server {
root /var/www/Minds/front/public;
error_log /dev/stdout info;
if ($host = 'minds.com' ) {
rewrite ^/(.*)$ https://www.minds.com/$1 permanent;
}
if ($http_x_forwarded_proto != "https") {
rewrite ^(.*)$ https://$host$REQUEST_URI permanent;
}
sendfile off;
location / {
try_files $uri $uri/ @rewrite;
}
......@@ -19,18 +28,55 @@ server {
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With';
set $cors "api";
rewrite ^(.+)$ /index.php last;
}
location ~* \.(png|jpg|jpeg|gif|ico|js|css)$ {
expires 1y;
log_not_found off;
}
location ~ (.woff|.tff) {
add_header 'Access-Control-Allow-Origin' *;
}
location ~ (composer.json|composer.lock|.travis.yml){
deny all;
}
location @rewrite {
rewrite ^(.+)$ /index.php last;
}
# Do not cache by default
set $no_cache 1;
# Cache GET requests by default
if ($request_method = GET){
set $no_cache 0;
}
# Do not cache if we have a cookie set
if ($http_cookie ~ "(mindsperm)" ){
set $no_cache 1;
}
# Do not cache if we have a logged in cookie
if ($cookie_loggedin = "1") {
set $no_cache 1;
}
# pass the PHP scripts to FastCGI server listening on socket
location ~ \.php$ {
try_files $uri =404;
add_header X-Cache $upstream_cache_status;
add_header No-Cache $no_cache;
fastcgi_cache fastcgicache;
fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
......
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 20000; #20k
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log off;
sendfile on;
#tcp_nopush on;
client_max_body_size 2G; #2gb upload limit
keepalive_timeout 65;
#gzip on;
fastcgi_cache_path /tmp/nginx_cache
levels=1:2
keys_zone=fastcgicache:10m
max_size=1g
inactive=30m;
fastcgi_cache_lock on;
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
fastcgi_cache_valid 5m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
include /etc/nginx/conf.d/*.conf;
}
FROM redis:4.0-alpine
COPY master.conf /usr/local/etc/redis/master.conf
#COPY slave.conf /usr/local/etc/redis/slave.conf
CMD [ "redis-server", "/usr/local/etc/redis/master.conf" ]
\ No newline at end of file
maxmemory-policy volatile-lru
appendonly no
appendfsync no
SAVE ""
timeout 0
tcp-backlog 65536
\ No newline at end of file
......@@ -2,6 +2,11 @@
echo "SYNCING: $S3_BUCKET"
aws s3 sync $S3_BUCKET $DIR
aws s3 sync --exact-timestamps $S3_BUCKET $DIR
echo "DONE"
\ No newline at end of file
echo "DONE"
if [ $KEEP_ALIVE ]
then
while true; do sleep 1000; done
fi
\ No newline at end of file
......@@ -60,7 +60,7 @@ services:
runners:
build:
context: ./engine
dockerfile: ./containers/php-fpm/Dockerfile
dockerfile: ./containers/php-runners/Dockerfile
depends_on:
- cassandra
# - mongo
......@@ -73,6 +73,7 @@ services:
- "./front/:/var/www/Minds/front"
- "./plugins/:/var/www/Minds/plugins"
- "./languages/:/var/www/Minds/languages"
- "./engine/:/var/www/Minds/engine"
nginx:
build:
......
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